Company: BlackRock_8thaug

Difficulty: easy

Problem Statement

Airport Baggage Handling System Problem Description An airport baggage hall receives bags one after another on a single belt. Every bag carries a printed tag with its own name and the destination it must be flown to. Before the bags are loaded, the handling system has to regroup them: all bags heading to the same destination must end up together, and the destinations themselves must be listed in alphabetical order. The order in which bags appear inside a destination group must be the order in which the bags arrived on the belt (the order they are given in the input). Splitting the belt into chunks and regrouping the chunks independently is allowed as an implementation strategy, but it must not change this result. Read the input from STDIN and print the report to STDOUT. Input Format The first line contains the integer numberOfBags . The second line contains the integer numberOfDestinations . The next numberOfDestinations lines each contain one destination name. The next 2 * numberOfBag

More BlackRock_8thaug OA questionsInterview experiences