Ad
  • Custom User Avatar

    indexOf on the alphabet array is awesome, love how concise it is! I picked this for best practice because you commented your code, in addition to writing legible code in the first place.

    Sorry to nitpick, but doesn't str need one character at the beginning? As written, str.indexOf('a') = 0, but the instructions specify a = 1.

  • Custom User Avatar

    Nice and concise. This solution returns the correct answer if input is valid. However, per instructions invalid input should return 0. This solution throws an error on non-int arguments.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution