You are given a list of string ids ids and an integer array timestamps of the same length. Record i has id ids[i] and time timestamps[i]. timestamps is given in non-decreasing order.
For a record i, look at the most recent earlier record with the same id as record i, call it record j. Record i is a repeat within the window if timestamps[i] - timestamps[j] <= 10.
Return the id of the first record, by index, that is a repeat within the window. Return "NONE" if no record qualifies.
Input: ids = ["tx1","tx2","tx1"], timestamps = [0,1,5]
Output: "tx1"
Explanation: The second "tx1" record, at index 2, has its most recent earlier "tx1" record at index 0. The gap is 5 - 0 = 5, which is at most 10.
Input: ids = ["tx1","tx2","tx1"], timestamps = [0,1,15]
Output: "NONE"
Explanation: The second "tx1" record has a gap of 15 - 0 = 15 from its most recent earlier "tx1" record, which exceeds 10. No id repeats within the window.
Input: ids = ["a"], timestamps = [0]
Output: "NONE"
Explanation: A single record has no earlier record to compare against.
ids.length = timestamps.length ≤105ids[i] ≤50, letters and digits onlytimestamps[i] ≤109timestamps is sorted in non-decreasing order