Open anshumanv opened 6 years ago
What is a different way it could be done?
Well we can map the values to object and then do a BST over the numbers and retrieve back the chain we need.
I gave this a shot in #46. This was a really good case for using a lookup table.
We are iterating over each object to match it's num, this is poor in terms if performance, please improve it.