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 know thank you
Would a bactracking solution be overkill?
Sick!!
I am feeling a little simple as I haven't figured out how the series is generated from line to line
Your solution is so terse my version is so verbose
I will try. Looking at the number we can see the smallest digit is 1 which appears in the number in several places, at positions 6,7 and 10 using 0 based indexing.
We choose the the last occurence of the minimumal digit to find the smallest number, so we can tranformer the number say to an array or string to using the built in
method lastIndexOf()
How is this a 5kyu?
I am not sure why thr first test and the first test only is not passing when using Javascript
OK it's not going to take much to sort this out, all I would have to do to pass your test case is to replace the 0 in the array to 1 and ignore the map function as javascript will does the necessary conversion in the reduce part. I am not sure how long ago I wrote this solution but I am sure I was new to the language, but thank you for highlighting the shortcomings with this solution thank you. Now if you can check the outs I have done that would be appreciated
Oh OK the solution works so I am not bothered really. I can't remember how long ago I wrote this tbh. It still managed to get 6 best practice recommendations and 5 clever so I am cool with it
I am confused is this comment regarding my solution
If you have the time could you possible explain your algorithm for this problem please
This comment is hidden because it contains spoiler information about the solution
Thank you so much for replying and your answer which was very clear.
The beauty of the solution is that is doesn't require the constant checking
22222 = 32 (2^5)
2+2+2+2+2 = 10
32%10 != 0 :- Therefore the sum of products of primes for 32 is not a factor of 32
Loading more items...