Domanda di colloquio di Roblox

Given a 2D array keystrokes (first element: integer, encoded letter i.e. 0 – a, 1 – b, etc. Second element: integer, time it took to press key after previous key). Times sorted ascending order. Return the letter with the slowest time

Risposta di colloquio

Anonimo

17 feb 2021

Not too difficult, but took 30 minutes. Make a map to decode the first element(integer) to a letter. For loops iterating through to find the longest value of time between each keystroke. Returned the key(letter) with the value