Post #17 is a great post! Thanks for thinking it through and sharing your thought process.
I misinterpreted the meaning of this instruction:
Your interpretation is probably correct, but I...
Type: Posts; User: GregBrannon
Post #17 is a great post! Thanks for thinking it through and sharing your thought process.
I misinterpreted the meaning of this instruction:
Your interpretation is probably correct, but I...
You can use an 'if' (or if/else) statement to filter characters outside 'a' - 'z'. This is a reasonable approach, since the instructions specifically address non-alpha characters differently.
Better. Add one or two more print statement to figure out what's going on. Your -97 offset for 'a' through 'z' is a good idea, but what happens when the loop gets to the space in the String?
Oh,...
I don't understand what in the heck you're trying to do, but this:
s.charAt(i)
can't work because i will become much bigger than the size of s.
Rarely is a double-nested loop required. ...