Ad
  • Custom User Avatar

    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.

  • Default User Avatar

    Simplified

  • Default User Avatar

    really, why don't you explain the example then. What's clear in your head, doesn't mean it's clear on others.

  • Custom User Avatar

    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.

  • Default User Avatar

    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.