Pseudo Sorting Algorithm
CodeChefOpen on judge ↗
Chef has devised a new algorithm which works as follows. It takes an array $a$ with $n$ integers ($a_0, a_1, \ldots, a_{n-1}$), and returns another array $b$. ```pseudo pseudo_sort($a$): - Array $b$ is initially empty. - For i = 0; i $\leq n$-1; i++: - If $b$ is empty, append $a_i$ to $b$. - Otherwise check if $a_i \ge$ last element of $b$ - If yes: - Append $a_i$ to $
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.
Sign in to chat with the tutor and save your progress.
Sign in to start