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 this is old, but if you calculate the percentage as percentage = (sum/x)*100 (or whatever your language) it should always return the right percentage, though you'll need to use math.Floor() or whatever equivalent if you don't want the decimals to run off into space.
This took me some time to figure out, too. Basically a new Array is being defined with a given length, and it's an empty array. Then this empty array is being joined, with a given letter joining the empty indexes. For example, for i = 2, the Array has 3 empty indexes: [,,] and then it is joined by whatever letter is in letters[i]. Say letters[2] equals the letter a. Then if we join the empty array together with the letter in between each empty index, you get "aa".
Simplified
really, why don't you explain the example then. What's clear in your head, doesn't mean it's clear on others.
I disagree. The number of candles on the cake is given, and mentioned in the description:
'''
The numbers of candles on the cake is provided (x).
'''
'''
You will work out the percentage of candles that will fall from the provided string (y).
'''
So if y is the amount of fallen candles, and the total number of candles (x) is given, you can get the percentage easily, several years of computer science or not.
nope, totally agreed with you. I am a several year computer science student and I can tell you that there are plenty of missing information. Trying to learn new language and test codewar, but there quite a few bugs on certain challenges. Good job at finding out the issue on this case.
I think it's unclear how to calculate the percentage of candles that will fall to the floor. In your example, the string y is 'abc' and has a value of 198. How do you calculate the percentage from 198? But then again I'm totally new, maybe I'm missing something?