I have a sequence of tuples like below. Number of "x" and "y"s occurred in documents "abc" and "xyz"
Seq(("abc", Map("x" -> 1, "y" -> 2)), ("xyz", Map("x" -> 2, "y" -> 1)))
How can I create an output like below from this above sequence.
Seq(("x", Map("abc" -> 1, "xyz" -> 2)), ("y", Map("abc" -> 2, "xyz" -> 1)))
xandyactually matter in the output? The maps in the input are not sorted. Should the output be sorted?