Ad
  • Default User Avatar

    As someone new to Java, both explanations are definitely very helpful explanations, and I will certainly be keeping these in mind. Thank you to the both of you :)

  • 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