You mean the word distinct?
Got me too, and now I have the solution which works for [3,3,3,3,3,3]
Tests in Ruby seem to be broken:
#<NoMethodError: undefined method `add' for main:Object>
main.rb:24:in `block (2 levels) in <main>'
Solution passes Attempt and submission though.
I had the same problem, also in Python. 1-4 random failures per attempt, then after 8 or so attempts, it passed.
This comment is hidden because it contains spoiler information about the solution
Well, you can surely solve it if you know that much :)
Whew, got it. Great kata! My solution ended up a little too generalized, so it runs a bit long, but it works.
you're being told a length smaller than the input length, yeah
while l < 100000:
l = len(str_) # <-- measure here
char = choice(list(total_chars)); n = randint(500,5000)
str_ += char * n # change it
# l is now outdated and shown to the user
Weird output from the Python tests:
Testing with a string of length = 101302, result = ['81', 6946, [97589, 104534]]
Why is the string length halfway between the longest substring indexes in the result? It's not the reason I haven't passed yet, but it's not helping with the debugging.
Great kata, lots of fun (and a little frustration) to get it right. Finding a way out was pretty easy, but building the path to describe it was harder.
I gave up, thanks anyway.
I don't know . Maybe it was a contamination from a similar kata with float coordinates I was writing at same time.
No problem. Well, revising my code, I understand (or I believe so) that you must not add the last prime you computed to the memo if it allows you to determine that the parameter is not prime. You must return False immediately. Does not make much sense... Hope this helps.
Sorry, forgot to mention, it's Python.
Which language? This kata is weird, seems easy but I could not figure out very well what it does, what it checks and what's the point of that... I solved it in Python but I could not in other languages. See the satisfaction rate is not very high...
I really don't understand what this wants me to do. I get the idea of not doing more work than you need to, but I'm apparently failing for not doing ENOUGH work, even though I'm doing exactly the right amount.
Take this example; this test fails where the previous primes length test succeeded.
Testing primes length after check for 74706941
It should work with random inputs too: expected a result close to 65, instead got 60: False should equal True
The prime factor that establishes that 74706941 is not prime is 281. 281 is the 60th prime number, so I did exactly as much work as I needed to answer the question. Why should I have to have done more work than that?