Im having a bit of a problem with this code each time i execute it it gives me an error
String index out of range: \'n\'
n - is the no. of characters that is entered in the tex
Use <, not <= when iterating over the string. With <=, you get an out of bounds error, when j equals the length of the string. Remember that characters in the string are indexed starting from zero.