Ad
  • Custom User Avatar

    Definitely a solid solution for when your interviewer wants a manual implementation. Two notes though:

    1. It's usually better to not use String concatination in a loop, and instead use the StringBuilder class
    2. Instead of checking each character in a giant boolean expression, a better / more maintainbale solution would be to use a Set of characters and simply check membership in the set