← All problemsSign in

Array Sorting

CodeChefRating 2349Open on judge ↗

Let $A$ be a permutation of $\{1,2,3, \dots, N\}$. We define a function $f(A)$ as the **minimum** number of **increasing** subarrays into which the permutation $A$ can be [partitioned](https://en.wikipedia.org/wiki/Partition_of_a_set). For example $f(\{5, 1, 4, 2, 3\}) = 3$, as the minimum number of increasing subarrays it can be partitioned into is $3$. The partitions are: $\{5\}, \{1, 4\},$ a

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