You are given a continuous stream of integers as input. Design an algorithm to process each integer and maintain the last k integers in memory. At any given point, your task is to find and output the smallest difference pair among the last k integers.
Anonymous
applied standard techniques using sets
Check out your Company Bowl for anonymous work chats.