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.
Hi myjinxin2015. Was just trying this on Kotlin, and it seems there's something wrong with the unit tests.
I had several attempts and saved the following values, that were expected to be "true", but are actually "false":
[4, 0, 8, 0, 8, 0, 0, 0, 9, 3, 0, 0, 0, 3, 4, 0, 0, 2, 3]
[7, 0, 5, 0, 0, 6, 8, 0, 0, 0, 4, 5, 0, 0, 4]
[2, 0, 1, 0, 0, 0, 4, 0, 3, 0, 0, 0, 2]
[9, 0, 6, 0, 0, 0, 0, 3, 0, 0, 6, 7, 1, 0, 0]
[8, 6, 5, 3, 4, 0, 0, 0, 0, 9, 0, 0, 0, 9, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 6, 6, 0]
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4]
[4, 2, 0, 8, 0, 8, 0, 0, 0, 8, 9, 7, 5, 8, 0, 0, 6, 5, 9, 0, 0, 1, 5, 7, 0, 0, 5, 6, 6]
Hope you could look into this.
Thanks!
Hahaha! Tried to avoid brute force as well, but alas, it's the only way I could get it right.
Tried doing it without recursion.
Didn't know you could iterate through a string that way. We learn something new everyday! :)
Good job sir!
Very clear and concise approach! Should have thought of that.
Thank you! :)
Hi! I'm running into this error:
Testing for [-76, 86, -51, 7, 64, -71, 97, 25, 17, 98, 50, 2, 75, -2, -59, 39, 86, -65, 77, 92]
It should work with random inputs too - Expected: 1.9863952136289137e+21, instead got: 4365703766217393700
Is this a bug? I've checked the output on an online LCM calculator and we both have the same answer. (http://www.calculator.net/lcm-calculator.html?numberinputs=98%2C97%2C92%2C86%2C77%2C76%2C75%2C71%2C65%2C64%2C59%2C51%2C50%2C39%2C25%2C17%2C7%2C2&x=94&y=9)
This is a really nice kata, and I really would like to finish it. Please let me know if there was just a bug in the test case. Thanks!