Interview Question
Team: Dev
Country: India
Please add more information about the questions. For example, i am not if the set has x elements, and will it have same value for the elements, for example, two 3, two 4,and if the different subgroup could pick the same element in the set as its size. Also i am not sure about the meaning of the "however the ordering of the group should be intact(cannot switch positions)", does it mean that only a continous sub parptition of the sequence could be in the one sub group? for example, if choose 3 as the size of first subgroup, then it will contain 0-2 elements of the sequence in the sub group, and if choose 4 as the size of the second sub group, then it will contains 3-6 elements of the sequence in the sub group, etc. I am also quite sure the meansing of "sum of squares of the differences of 1's and 2's in each sub group", is the the sum of the squares of the differences of number of 1's and number 2's in each sub group? So if the subgroups is:
121111, the difference would be 4, the square is 16? Please give some example showing the question's requirement. Thanks.
And one more question is that is X fixed?
Please add more information about the questions. For example, i am not if the set has x elements, and will it have same value for the elements, for example, two 3, two 4,and if the different subgroup could pick the same element in the set as its size. Also i am not sure about the meaning of the "however the ordering of the group should be intact(cannot switch positions)", does it mean that only a continous sub parptition of the sequence could be in the one sub group? for example, if choose 3 as the size of first subgroup, then it will contain 0-2 elements of the sequence in the sub group, and if choose 4 as the size of the second sub group, then it will contains 3-6 elements of the sequence in the sub group, etc. I am also quite sure the meansing of "sum of squares of the differences of 1's and 2's in each sub group", is the the sum of the squares of the differences of number of 1's and number 2's in each sub group? So if the subgroups is:
- Anonymous March 25, 2013121111, the difference would be 4, the square is 16? Please give some example showing the question's requirement. Thanks.