[key, at]: the key number and the moment it was pressed. The entries in presses are in increasing order of time.
A press lasts from the previous press until this one. The very first press lasts exactly at (the clock starts at zero).
Return the number of the key whose press lasted longest. If several presses tie, return the smallest key number. The same key may show up more than once; each press counts on its own.presses=[[4, 3], [7, 4], [2, 10], [9, 12]] → 2
Durations: key 4 took 3, key 7 took 1, key 2 took 6, key 9 took 2. Key 2 was the slowest.
presses=[[8, 5], [3, 10]] → 3
Both keys took 5 time units; on a tie we pick the smaller key number, 3.
presses=[[6, 1], [6, 5], [1, 6]] → 6
at values are strictly increasingpresses=[[4, 3], [7, 4], [2, 10], [9, 12]]
2
Run checks the first 3 tests in your browser. Submit checks all 106 tests on the server, hidden ones included.