Design timebase keyvalue data structure store multiple value key different time stamp retrieve key value certain timestampimplement TimeMap classtimemap initialize object datum structurevoid setstre key String value int timestamp store key key value value give time timestampstre getstre key int timestamp return value set call previously timestamp_prev timestamp if multiple value return value associate large timestamp_prev if value return Example 1inputtimemap set set foo bar 1 foo 1 foo 3 foo bar2 4 foo 4 foo 5outputnull null bar bar null bar2 bar2ExplanationTimeMap timeMap new TimeMaptimeMapsetfoo bar 1 store key foo value bar timestamp 1timemapgetfoo 1 return bartimeMapgetfoo 3 return bar value correspond foo timestamp 3 timestamp 2 value timestamp 1 bartimeMapsetfoo bar2 4 store key foo value bar2 timestamp 4timemapgetfoo 4 return bar2timeMapgetfoo 5 return bar2 Constraints1 keylength valuelength 100key value consist lowercase English letter digits1 timestamp 107all timestamp timestamp set strictly increasingat 2 105 call set