Interviewer spent 5 mins for introductory discussion and then pasted this question in the coderpad.
Corrected shortly after interviewer points this.
Solved Using HashSet, just after interview relaized that it can be solved using sliding window, neither interviewer told me to optimize it further.
Interview completed in just 35 mins.