← All problemsSign in

Oddsway

In a pendulum arrangement the elements of an array are arranged in a way such that their sorting traversal resembles the sway of a pendulum. For instance, Given elements: {5, 3, 7, 2, 1} Sorted order: {1, 2, 3, 5, 7} Pendulum arrangement: {5, 2, 1, 3, 7} A pendulum arrangement is said to be an odd sway if every element in the odd position (1 – indexing is assumed) of the arrangement sums up to som

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