Capital One Interview Question

How would you go about making this code simpler? Basic Big(O) type questions for common data structures