Debounce a Search-Box Keystroke Stream

Asked at Mobile · Mobile Engineering (Android/iOS) · Difficulty: Medium

A search-as-you-type box must not fire a network request on every keystroke. **Debouncing** waits until the user pauses typing for `delay` ms, then fires one request. (On iOS this is Combine's `.debounce`; on Android, Flow's `.debounce`.) Given the keystroke timestamps, output when the debounced requests actually fire.

Loading the problem…