Capgemini Interview Question
- 1of 1 vote
You and your friends are pilots in the Clone army.You are facing the aerial fleet of the Droid army.Droid planes move while maintaining a long line so that their shields interact making it impossible to shoot down planes in the middle of the line.Thus,your only option is to keep shooting down planes at the edges of the line.- shukad333 September 11, 2014 in United States
You and your friend have decided to make a game of it.Each Droid plane has an importance level IMP[i].Since the droid planes don't advertise their importance levels, both of you must follow a mixed strategy and shoot down either the first plane or the last plane with 50% chance each.If there is a single plane,the shooter with the turn will shoot it down for sure.The two of you take turns to shoot down enemy planes.You have the first turn.What is the expected sum of importance levels you will shoot down?
# The number of droid planes
# An array containing the importance levels of droid planes.
A string containing your expected sum of importance levels of shot down planes,rounded to 3 places of decimal.
| Report Duplicate | Flag | PURGE
Open Chat in New Window