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.
It's a bug in your solution. My kata works fine.
All these explosions happen at the same time. You cannot process it one by one. And you create some new shelters from existing ones (??) Please read the description and samples again. The logic is rather simple and you overcomplicate it.
[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.
Size of data type depends on platfrom, and can be different between compilers. On CW, for Cand for C++, it is:
you can check the size of a long with sizeof(long)
isn't that for long long int?
9223372036854775807 is max positive for a long int.
The C test case has a value of 9999999999 which is not in the range of long int.
How should I handle such behaviour?
This comment is hidden because it contains spoiler information about the solution
Iterating over the set of N possible fractions with a denominator d less than or equal 1 is O(N) in complexity. Perhaps your algorithm can be optimized?
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. (;´༎ຶٹ༎ຶ`)
This comment is hidden because it contains spoiler information about the solution
Loading more items...