Ron McLeod wrote:.. and Welcome to CodeRanch!
Ron McLeod wrote:What are you expecting, and what are you seeing for a given input?
If an isogram is a phrase without a repeating character, then it seems like your logic is reversed. The default is that it is not an isogram, but when you detect a repeated character, the result is being updated to indicate that it is an isogram.
salvin francis wrote:I think a single loop can easily figure out an Isogram like this:
As Carey suggested, a better method signature can be:
Can you work out the changes required for ignoring case ?
You know == doesn't work on Strings.Sabrina Cux wrote:. . . for the last line . . .
Campbell Ritchie wrote:
You know == doesn't work on Strings.Sabrina Cux wrote:. . . for the last line . . .
salvin francis wrote:I think my code would only fail for "moOse" since my code does not ignore case. It should also work for blank string so no blank check is required.
Can you work out a case-insensitive solution ?
Sabrina Cux wrote:... Thanks for your solution, my way keeps its mystery.
salvin francis wrote:
// -- Wish I knew a shorter way to convert String to List of characters
There are three kinds of actuaries: those who can count, and those who can't.