publicmays / Cracking-Coding-Interview

3 stars 7 forks source link

isUnique() is broken in https://github.com/katlew/Cracking-Coding-Interview/blob/master/chapter_1/isUnique_bit.java #2

Open millfreedom opened 5 years ago

millfreedom commented 5 years ago

HERE you have broken isUnique() method

try this, e.g.: if (!isUnique("[{")) throw new RuntimeException("over-optimisation detected");

lejaokri commented 4 years ago

isUnique_bit() will only support lower-case ascii characters. should have added it in the comment.