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.
I love this solution!
10 is NOT the maximum number of digits in the number, but the number of (possible) different digits in a number. And there are only ten: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Each of the 10 array elements is used to count the number of occurances of the respective number, e.g. digitsCount[5] counts how many occurances of 5 are in the input.
Based on the type of the argument (int), it can fit any number less than 2147483647 so considering the program with 10 should be fine.
This solution is absolutely brilliant!!!
What if the 'num' will contains more than 10 numbers?
You need to determine the array size before
An Elegant solution without using any extenal API's.
Wonderful English!
Amazing! Without any special java methods, just a brilliant idea!
this also works for arbitrary large numbers, which is a bonus
Brilliant! Awesome! Unbelievable! I initially thought this puzzling kata would be unsolvable without using Strings and Streams API stuff. And then there is such a simple and easy solution to this problem. Wow!
I don't think so.
Good kata, but need to add some tests like a
-3.
,50.
etc.My solution was applied, but returns true with examples above. Good luck further
Does it necessary paste "+" after first character class?
No worries ^^
This comment is hidden because it contains spoiler information about the solution
Loading more items...