Angi interview question

1D array distance problem and a time series logging aggregation problem