keys lists the keys in the order they were pressed, and release_times[i] is the moment the i-th key was released (0-based).
The first key went down at time 0, and each next key went down exactly when the previous one was released. So the i-th press lasted release_times[i] - release_times[i - 1], and the very first one lasted release_times[0].
Return the key whose press lasted the longest. If several presses tie, return the key that comes latest in the alphabet among them. The same key may have been pressed more than once, with a different duration each time.release_times=[4, 6, 12, 13], keys='mkqm' → 'q'
The presses last 4, 2, 6 and 1. The 'q' was held the longest.
release_times=[5, 10, 13], keys='bab' → 'b'
Both 'b' and 'a' were held for 5. On a tie we pick the letter later in the alphabet, which is 'b'.
release_times=[1, 100], keys='zz' → 'z'
keys consists of lowercase English lettersrelease_times=[4, 6, 12, 13], keys='mkqm'
'q'
Run checks the first 3 tests in your browser. Submit checks all 30 tests on the server, hidden ones included.