Ad
  • Custom User Avatar

    This problem doesn't always work on random test cases, in scenarios where (i >= 10). If the shoal has a pattern that matches a 2+ digit number, (shoal.split(i) - 1) would be greater than 0, and would add fish that don't actually exist (since fish in the shoal are only size 1-9). Otherwise using .split() is a really nice way to parse the shoal.