Ad
  • Default User Avatar

    but R keeps getting the correct answer which is 81

    It is not R but your code:-)
    All languages give the same answer for that fixed test and the kata was passed by 4396 guys. Are you using the given formula and are you returning the *floor* of the maximum?
    PS: By the way you could have given the considered input.