Thanos and the Infinity Stones
CodeChefOpen on judge ↗
In the near future, Thanos goes on a killing spree to collect all the infinity stones and the only stone the Avengers finally have a hold of is the Time Stone. To save the universe, they decide to use it to go back in time whenever necessary without causing severe changes to the laws of nature. Help them by answering a few queries. The infinity stones are numbered with indices starting from 0. As
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