Ad
  • Custom User Avatar

    Think of it as a math problem, moreso than a programming problem. It's really both, but the solution doesn't require fancy JS methods (and frankly, doesn't work with them).

  • Custom User Avatar

    Should 13 be balanced? The tests seem to think so, but if I understand the problem explanation correctly, it shouldn't be because 1 != 3. Same with 56239814.

    5+6+2+3 = 16 and 9+8+1+4 = 22. 16 != 22 so shouldn't the correct answer be "Not Balanced"?

    Note: after much deliberation, I removed the spoiler tag because anyone who opens the kata can see the sample tests, so I assume they don't count.

  • Custom User Avatar

    Not really. This has arrays within an array, and the goal is to find the minimum in each array and add them. Neither of those katas have the same objective, or even work with the same dimension of array.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You don't need both 'return 1;' statements. If you have two or more case statements in a row with no return or break statement, the next statement will handle those cases together. In other words:
    case 1:
    case 2: return 1;

    functions the same as:
    case 1: return 1;
    case 2: return 1;

  • Custom User Avatar

    This is an interesting solution.