LinkedIn interview question

Optimize a class for the TwoSum function.