← All problemsSign in

Avengers vs Thanos

The Avengers and their allies are currently fighting Thanos in a grand battle. Avengers have found a way to defeat Thanos by combining the energy of his attacks with their own energy. There are "n" Avengers, Energy of the "i"th avenger is "E[i]". If Thanos attacks "x" times, each time, energy of "i"th avenger becomes E[i] | E[i-1], where 1<=i<=n. " | " represents bitwise OR. Print energy of all Av

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