CtCI-6th-Edition icon indicating copy to clipboard operation
CtCI-6th-Edition copied to clipboard

Update QuestionA.java

Open rohitgmait opened this issue 7 years ago • 4 comments

Since alphabet set still consists of 26 characters going by the QuestionB answer

rohitgmait avatar Jun 27 '17 10:06 rohitgmait

Alphabet set contains 26 characters, so if any string contains more than 26 characters that means characters are not unique

wish2gift avatar Oct 14 '17 19:10 wish2gift

@wish2gift it's a string, so it can contain any 'character' apart from the standard 26 English alphabets. Essentially the 256 characters can be held in the string data type, so you cannot exclude the other 220 characters. For eg: a string - "hEL1O" is a valid string, which has both upper case alphabets that you need to check (26 upper case characters), and lower case characters (26 lower case) and numbers (10 numbers) etc. Hence, all edge cases need to be evaluated.

KrishMunot avatar Oct 14 '17 19:10 KrishMunot

Going by that logic, QuestionB.java needs to be corrected!

wish2gift avatar Oct 14 '17 19:10 wish2gift

@wish2gift Please do suggest those changes and I can review them

KrishMunot avatar Oct 14 '17 19:10 KrishMunot