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.
O(n log n) solution, this can be completed in O(n).
O(n log n) solution. Not really sure I'd flag that as best practice.
Not sure why some are suggesting O(log n). Binary search only works on an ordered set. These numbers are not ordered. The fastest you can possibly achieve this is O(n). You must iterate through all the digits to ensure even the very last digit is within the rules.
Note due to formating issues codewars changes some of my * to italics.
This comment is hidden because it contains spoiler information about the solution