Company: Deloitte_23feb

Difficulty: medium

Problem Statement

A running club is mapping out a marathon course through a stretch of mountainous terrain. Because the area sees very few people, the organizers want to make sure no runner ever loses the trail. The course has several checkpoints, and every checkpoint is supposed to feed into exactly one checkpoint further down the route. Because different crews wired up the connections independently, a few mistakes crept in, and some checkpoints now feed into more than one downstream checkpoint. Each checkpoint is identified by a random integer. Write a program that finds every checkpoint feeding into more than one downstream checkpoint, and print the sum of those checkpoint values. The course layout is given as a list of relations tying each checkpoint back to the starting point. Each relation is written as a string like L, R, LL, LR, and so on, where the checkpoint sits to the left (L) of the starting point, or left-then-left (LL), or right-then-left (RL), and so forth. Read the input from STDIN and

More Deloitte_23feb OA questionsInterview experiences