Ad
  • Custom User Avatar

    I would avoid hardcoding what a valid town can be. While that might work on the test cases presented here, it would only take an additional test or two to cause this code to break. Instead, I would rely on the data given to you, and figure out a way to parse that to determine what a valid town is. That allows your code to be much more flexible in what it can handle.