glad I didn't have to do that because my function is 100% correct :)
@Twilight_Sun, it is actually a valid puzzle:
There are 10 distinct letters: AEFHILORST, nine distinct leading letters: AFHILORST, and solution without leading zeroes does exist.
(It's easy to deduce here that E is 0 although no special-case for this deduction is needed to code it).
ha, have already read that book ;) It's really good and practical although I still have no clue how exactly lens types work together.
One last thing is to get paid for doing Haskell somehow
I really recommend the Optics By Example book by Chris Penner.
It's a cool solution, isn't it? :3
I have been acting like a wildman trying to find what I'm doing wrong!! Thank you!!
a bit verbose but efficient
Sure. Both list spine and elements are lazily evaluated in Haskell. The list that times out is short in spine, but the last element takes forever to evaluate.
So in Haskell version you need to find the answer without ever touching the last element (!), which makes it very different and much harder than same kata in any other language
Any tip you could give on what kind of optimization we should be looking at?
I tried a naive memoization and, of course, the timeout is still there.
I gave up some days ago on some haskell codegolf-like challenge (Weak Primality Test) and I don't want to make throwing in the towel a habit :D
The same thing appears in Python tests as well. The Description says there's no ranking of suits, so it may just be that suits are irrelevant except in the case of a flush.
Not sure if that counts as spoiler but there's an article on fpcomplete.com about lenses that explains a lot and is very helpful for this kata (it is required to have idea about RankNTypes though)
after few failed attempts to submit an O(n) code (12 sec timeout) I gave up and unlocked solutions. Most of them are less efficient and none of few that looked interesting passed the tests, all failed with timeout
UPD: it did pass with a near miss time after repeatedly submitting the same code many times.
Yes--only admins can change them.