Ad
  • Default User Avatar

    The denominator should just be the length of the string. The numerator will be incremented by 1 each time you see a character that is greater than 'n'. Hopefully that helps enough for you to solve this one!

  • Default User Avatar

    Your code would be better if you wrote;

    if(s.chatAt(m)>'n') c++;

    Instead of listing each char individually!