Sorted Groups
You are given a string $S$ of length $N$ consisting of lowercase English letters. Positions are numbered from $1$ to $N$. You must partition the set of positions $\{1, 2, \ldots, N\}$ into two groups $A$ and $B$ (either group may be empty). Then, for each group independently, perform the following operation: - Collect the characters present at the group's positions. - Sort these characters in non
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