Thursday, 27 February 2014

Problem 3

Say that a "clump" in an array is a series of 2 or more adjacent elements of the value. Return the number of "clumps" in the given array.
Sample Test Cases:
countclumps({1,2,2,3,4,4})→2
countclumps({1,1,2,1,1})→2
countclumps({1,1,1,1,1})→1

No comments: