← All problemsSign in

Increasing or Decreasing

Chef just proposed his crush but she gave Chef a problem instead. She gave some arrays of size upto $N$ and told him, he is allowed to do only swap operation between two indices $i, j$ such that $0 \leq i,j \leq N-1$ any amount of time. Chef needs to determine if he can make the array $strictly$ increasing or decreasing. She will accept Chef's proposal only if Chef solves the problem. Please he

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