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.
How is calling into the possibly non-trivial function pow() instead of simply writing "diff * diff" a "best practice"?
Probably because ChatGPT was trained on code like this. This solution is from March 2019 so it predated publicly available ChatGPT by a few years.
look like ChatGPT's answer
Looks clever, but will this work regardless of endianess??
This comment is hidden because it contains spoiler information about the solution
please explain how it works?
Heck I missed the isdigit() utility, it might have made my solution much simpler...
The only improvement for your solution: rather than using magic numbers to convert char to int, You can literally do ISBN[i] - '0'.
I think this code doesn't allocate enough space for the null terminator at the end of the string! As far as I can tell (from docs and quick experimentation), strlen() doesn't count the null terminator.