Ad
  • Custom User Avatar

    Your solution outputs false for arr = [1, 2, 3, 6, 2, 3, 4, 7, 8], groupLen = 3.

    Meanwhile, with the given array and group length, you can make:

    [1,2,3], [2,3,4], [6,7,8]

    which all of the groups have its' elements in consecutive number order.

    The output should be true.