Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are at a shooting range. You have N target labeled from 1 to N from left to right. Your task is to shoot the
You are at a shooting range. You have target labeled from to from left to right.
Your task is to shoot the target by performing the following operation.
In each round starting from the first element and moving from left to right, shoot every alternate target.
Repeat the above step until only one target is left.
By shooting a target labeled i you will get i points.
Task
Return the total number of points you will get by shooting targets until only one target is left.
Example
Assumption
Approach
Targets
Initial points
Targets Targets to be removed are Points
Targets Targets to be removed are Points
Targets only one target is left therefore return total points ie
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started