Ad
  • Custom User Avatar

    This problem is NP-Hard, so it's unlikely it can be made any more efficient.

  • Custom User Avatar

    Never assume your code not working is an issue. An issue is a bug in the kata and it needs to be proved. I strongly advice you to read carefully the official recommendation page: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    It is a little confusing. Regarding the example, this may help a bit. I don't think it's a spoiler.
    maxSequence([-2, 1, -3, (4, -1, 2, 1,) -5, 4])

  • Custom User Avatar

    Read the comment by 'NHerwich' from about 8ish months ago(prior to my comment). That person explains the basics, the kata description talks about if all numbers are negative or if the array is empty. One other maybe helpful clarification is that a single(positive) number in an array can be the answer if it happens to be the only number, only number > 0, or if no other amount of numbers added together is greater than it.

  • Custom User Avatar

    The real miles number can contain 4. Let's see 55: it skips 4, 14, 24, 34, 40 and 54, so 55 - 15 = 40.