Ad
  • Custom User Avatar

    I love this solution. I was thinking that essentially all we were doing was a lookup, so an object would have been perfect, and I also wanted to use a switch statement but was too tired to implement it properly. This one is a great example of when to use a hash table for lookup and best use of the Big O consideration of the exercise.

    Love it mate, good job. Will keep this kind of approach in mind going forwards.