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.
Yes UB indeed, I just went with obfuscation mode. (-:
JS translation
does not yet have
permuts(0)
I still see
unsigned
in the function signature and the description still has "Values up to n = 200 will be tested." ??( Python, possibly C )
Add a test for
permuts(0) -> 1
( because[] -> []
is valid ).Or specify
n > 0
. But that's the chicken way out of course.this is the same in the Python version, because this kata is a puzzle
fixed
C translation doesn't actually calculate the requested Kata outcome, because the result doesn't fit the
unsigned
return type.Either limit the input for the C solution, or use larger return types (or both).
C translation doesn't show expected value, only "Incorrect Result".
Not sure if this is intentional, but usually that's not acceptable.
the
i++
is undefined behaviordescription now states:
LOL! I made it my personal challenge to solve all Codewars C problems with short but readable solutions. I've developed my own style throughout the years, which is not to everyone's taste, but I obviously like it. I'm almost there, but am now stuck with the hardest problems... It requires more of my time to solve these remaining problems, I'm not sure I will have enough time.
There are lots of interesting problems out there!
See if you can solve https://www.codewars.com/kata/5993c1d917bc97d05d000068/c
Yeah, I’m a pretty weird dude. I have an entire list of various sayings, quotes, and aphorisms from different people and languages. I'm pretty sure that particular one comes from a Latin book I have called Sententiae by Publilius Syrus. Most of the Latin ones I use are from him. He has a ton of good ones. You should check it out.
Yes, I’ve learned quite a few tricks from Code Golf on Stack Exchange. That said, I don’t post there like I do on Codewars. I just really enjoy trying to find the shortest C solution possible for each kata. It’s not just about code golf though, sometimes it’s about finding something equally as clever, like using shellcode tricks or inline assembly.
It feels like I’m always learning something new from someone’s unique solution. That’s really what I love about Codewars. But you’re totally right, I should visit Code Golf SE more often.
“Aliquid semper addiscendum est.”
Thanks, first time I've encountered someone quoting Latin proverbs.
If you like code golfing, why not try: https://codegolf.stackexchange.com/ ?
I think you miscounted, moving the body into the for statement doesn't save any characters.
As for K&R style, I don't like it, and it is removed from C since C23.
As for the header,
size_t
is compiler dependent, so there's no portable way to drop the header. I usually don't care too much about the includes.thank you for the upvote
Loading more items...