Rupeek interview question

1. Two pointer and sliding window approach