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.
The use of Float80 for factorial calculations may help avoid integer overflow, but it introduces potential for rounding errors. The optimization to check only up to n/2 is clever due to the symmetry of binomial coefficients; however, this could miss solutions where x is greater than n/2. Consider an iterative approach to calculate combinations, which is typically more efficient and avoids the complexities of floating-point arithmetic. Additionally, ensure the function can handle cases where the solution is on the higher side of n/2.
I also like your solution, but when I test it with the following function call, empty arrays are returned - but not all of them...
flattenTwoLevels([1, [], [2, 3],[4, 5, [6, 7, 8], 9, [], 10, [11, [12, [13, 14], 15], 16], 17], [], 18]) ->
[1, [], [2, 3], [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [], 18]
Hi, I didn't make the Swift translation (which I assume is the one with the one with the
Dot
) you're commenting; yet, I checked the code, and found this in the preloaded code for the kata:Hope that helps with your doubt, but as I don't code in Swift, I wouldn't be sure if that's what you're looking for.
What's the Dot class? It's not included in the starting code, should be String or something
Should have explain better on this seriously, "come before" can be understand as stand before as place in the string, so "2000" start with "2" and "11" start with "1", if sort by string then become "11 2000"
I guess this kind of assessment is rather subjective: if you are good with regex, several katas using them would feel like they are 1-2 kyu too higher for you, but for most devs they are not such a piece of cake.
Got it :D It's just that I think many more 6 kyu kata is way harder for solving, maybe due to different in language
Judging from the sheer number of users who add troubles completing it and that 7 kyu should be really a beginner-ish kata, I might beg to differ.
This seems to be too easy for 6 kyu, should be 7 kyu?
Also cant find the answer for this crap, to initial is not correct since it will always product rounded number, but the result is a double, to the price getting updated every month then i get 355 after month 6, super confusing
like seriously, cant he just print the expected so that people can see where is the wrong part, sad life
Can someone print the expected in the
Array should have same length
?, Like this we cant even know what we did wrongWhat kind of test passed 207 cases but wrong on 1 eg.(100,100,100,100, I return [(0,20000)]) ??? I think testcases on Swift is wrong
The swift version of this have no test cases at all