Question d’entretien chez Disney+ Hotstar

Q. Subarray problem to get pairs in array.