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.
Damnit I spent so long looking for an equivalent function for nCr and it was right there 😔
You can use the inclusive range operator ..= rather than .. to get rid of the +1
This comment is hidden because it contains spoiler information about the solution
Hey, samesies! I don't quite see the point of converting the vec to a tuple, since it just changes how you access the elements, but eh
Why would you do
for &(n, symbol) in symbols.iter {
instead of justfor (n, symbol) in symbols {
?You know I feel like that array could've been constructed somewhat more concisely. You never know though
Great puzzle, but the description needs to be more clear on what is expected, maybe adding some more examples of expected output. Specifically, that two equal functions should return True, and two functions that don't intersect should return False.
This comment is hidden because it contains spoiler information about the solution
Instead of breaking just to return list straight after, you can just replace
break
withreturn list
This comment is hidden because it contains spoiler information about the solution
Unused memory isn't leaked. There's just a bunch of undefined bytes after the null byte. It still gets freed when the memory is freed using free, since the OS keeps track of the number of bytes allocated when you call malloc.
Imagine if this was an int array not a char array, a 0 in the middle of the array wouldn't cause any memory to leak.
This comment is hidden because it contains spoiler information about the solution
What's the purpose of NULLing p before returning? Seems unnecessary, and it definitely shouldn't be done with that comma syntax
This comment is hidden because it contains spoiler information about the solution
Only works if s doesn't contain â•ž lol
Loading more items...