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.
My Solution! Haha!
kudos if this was on purpose, else i recommend checking out regexp :)
Yeap))
yeah this kata needs random tests
I usually manage 4kyu challenges in 30 mins or less, but this took me 6h40mins! I'm not inexperienced in code golfing.
It was an amazing challenge and I enjoyed every minute, even if I slowly lost my sanity.
I think it should be ranked 2 or 3 kyu
Description says:
"Given n (integer > 2) write the function comp(n) returning the number of times where a term of u is less than its predecessor up to and including u[n]."
comp
andlengthSupUK
are terrible function names. I got stuck for 10 minutes thinking thatcomp
was about calculating then
th number inu
. Please change them to something more intuitiveThis comment is hidden because it contains spoiler information about the solution
Truncating results doesn't add anything but confusion to the kata. Should I truncate intermediate results? If not I can't use recursive code. Just don't, and polish up the tests.
It's also practically a double of the Evaluate Mathematical Expression - needed one more line of code for the functions. (Oh, and two minimal adjustments to the tokeniser.)
Still, if you do it right, it adds functions to said kata. It's a lot more interesting to build a parser (again, and again, and again) than to find the umpteenth cheat (again, and again, and again) that hasn't been disabled.
What?
This comment is hidden because it contains spoiler information about the solution
Add more example cases.
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 comment is hidden because it contains spoiler information about the solution
Loading more items...