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 is for Javascript]
Can I get some help here? It keeps failing on random test cases, I think my result is right.
If not, could i get an explanation? Because even in my head - if i manually try and do it, that's how it should be.
E.g
Battlefield: rbpl[l]#m[cwd]bzu[pvx]###[tq]on expected 'l' to equal 'lcwd'
Battlefield breakdown:
rbpl[l]#m[cwd]bzu[pvx]###[tq]on
[l]#[cwd][pvx]###[tq]
[l]#[cwd][pvx]###[tq]
[l cwd ][pvx]###[tq]
[l cwd ][pvx##tq]
[l cwd ]pvx#tq
l
Likewise, as someone else in the comment section - I ran this:
Testing for [flrxgj][eyadcb]s#sgryedufaxwzegqeezrjcirqaoce#dcaigasncuemtphwijoyuroa[gdlmvrsj]pacjkssikw Expected: "flrxgjeyadcbgdlmvrsj", instead got: "flrxgj"
Additional Random Tests:
Battlefield: nqt[pav]d#[k]pu[qv]#[vyp]#d[dw]##
[pav]#[k][qv]#[vyp]#[dw]##
[pav]#[k][qv]#[vyp]#[dw]##
[pavk][qv]#[vyp]#[dw]##
[pavk][qvvyp]#[dw]##
[pavk][qvvypdw]##
[pavk][qvvypdw#`
expected 'pavk' to equal 'pavkqv'
Correct, it should be
[ '1/2',
'1/7',
'1/59',
'1/5163',
'1/53307975',
'1/9007199254740992' ]
Above is wrong because javascript makes issues in its math calculation. Best to round each of your answers then do calculation.
This comment is hidden because it contains spoiler information about the solution
Idk you are definitely getting better cause i struggled big time with this. But mainly because I went through so many different solutions, wasting time and stuff; the trick here was i expected everything to be sorted.
In the end, pulled out the good ol' sort algorithms, and finished it in 30mins. I should say my solutions are always super unique to everyone elses.
This felt harder than any problems i solved so far :x - and i did some 4kyu problems.
But was hella fun!
Great kata
wow this eloquent coding completely destroys my trash behemoth of a code. (;´༎ຶٹ༎ຶ`)
well.. this was way easier than i made it ought to be initially.
Some other people's solutions though, doing in a liner -
I want to do that one day