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.
You have a number n(let's say 10) and you need to square all numbers from 0(including) to 10(including).
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 --> 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
Let's say that we want the digit '1'. In squared array we need to sum up all digits that are '1'. (Keep in mind that if we have, for example, squared number 121, that has two digits '1', then we are adding both of them to the final sum/counter).
0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 -->
0, 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 1 = 4
I hope this helps. :)
This comment is hidden because it contains spoiler information about the solution
Not a kata suggestion, please read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#post-discourse
This comment is hidden because it contains spoiler information about the solution