← All problemsSign in

Mike and GP

Mike is a naughty child. He never takes his classes seriously. He usually plays mathematical games in his boring lectures. This time he started writing an infinite GP of positive numbers with a common ratio of 2. 1,2,4,8,16,32,64,128..... He named this series as M-series and made a game. The rules of the game are as follows: You will be given an array of N numbers (0 based indexing) and will be

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