← All problemsSign in

Alice and Array

Alice has a non-negative integer array of size $N$. She asks Bob to find the start and end index(1-based) of smallest continuous subarray such that if she sorts that subarray then the complete array will be sorted. Print -1 if no such subarray exist. ###Input: - First line will contain $N$, number of testcases. - Second line contains $N$ space separated non-negative integers. ###Output

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start