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.
A testcase could be n = 4000, m = 4000, which will evaluate to -96 in i16
An excellent point. Though for the scope of the problem it would hardly matter.
You don't need the extra parentheses if you wanted a cleaner oneliner
if there's an
x
in the string, then the input is invalidgood, but if input string have a "x" char this solution doesnt worked.
best.
very clever and clean => best practice ๐
100% it is a best variant, geez, genius and minimalistic
I didn't even think of that. I used if
Approved some time ago
Please update the rust version.
You have to look for harshad numbers, where the product of "sum of digits" and "sum of digits"[::-1] is the number again. Now lets have a look at the sum of digits.
9: you need at least 1 digit to get this. And 9 * 9 = 81 (2 digits). No problem.
99: you need at least 11 digits to get this. And 99 * 99 is < 10.000 (4 digits). For bigger numbers this is getting worse, so the matching harshad numbers are below 10.000. And there we have just these four numbers...
the test cases weren't long enough I guess
Oh for Pete's sake... :)
Easy to read. Nice logic.
Loading more items...