Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I found the answer in the linked kata. The subarrays should be contiguous, so the answer for the above example is {{2}, {2}, {2}, {2}, {3}, {2,2,2}, {2,2,2}, {2,2,2,3}, {2,3}} and the result is 9.
I should read the description more thoroughly. :)
Could someone help me understand the requirements? Given an input {2,2,2,2,3} will the correct answer be the "8"? Because, the result range is {{2}, {2}, {2}, {2}, {3}, {2,3}, {2,2,2}, {2,2,2,3}}? Or the {2} sub-array should appeare only odd number of times and the answr will be "7"?
If my logic is incorrect i'd be glad to see the example for the input above.) thank you in advance.