Ad
  • Custom User Avatar

    I believe it is because you have not split the string into separate letters with str.split(''). Therefore when you call str[i] without it being an array you get an error message.