Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
If both the digit sums add up to 9, then both numbers will be evenly divisible by 9. It's not possible for the digit sum to be 0 since the inner string is always at least 1 character long.
So how to explain that
18 => (1 + 8) = 9 - the sum of the digits is 9
but
18 % 9 = 0 and 0 != 9?
thanks for asking so i didn't have to
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This should be sticked somewhere... !
Nice !
This comment is hidden because it contains spoiler information about the solution
Thanks for the comment. When I refactor code I try to ditch repeated patterns, I try to do this keeping the meaning clear, sometimes it works better thn others.
Because [4, -1, 2, 1] is the subsequence with the greatest sum (6) in [-2, 1, -3, 4, -1, 2, 1, -5, 4].
Any other subsequenc would have lower sum than that for example
So you have to find the subsequence of any length that produces the greatest sum.
None ;)