Belzabar Test

April 5, 2018 | Author: Anonymous | Category: Documents
Report this link


Description

A team of Egyptian archaeologists were performing excavations at a site called R amesses Fortress. The fortress is famous for its ancient Egyptian art forms char acterized by regularity and detailed depiction of gods, human beings, heroic bat tles, and nature, intended to provide solace to the deceased in the afterlife. Along with ancient Egyptian paintings they found a very huge door, but to their utter dismay they could not open it. Upon trying all the tactics to open the doo r they finally gave up!! At that very moment they came across a painting which had the key to open the do or. The key to open the door was to place a combination of 25 ancient Egyptian word s in such a way that the last alphabet of each word should be the starting alpha bet of the next word. Each archaeologist started forming their own set of words to open up the huge do or. Now the objective is to code a program that can determine if the set of words su ggested by each archaeologist follows the rule [starting from first word the las t alphabet of each word should be the first alphabet of next word] mentioned on the ancient Egyptian art & if it can be opened with those set of words or not. Please note that the words provided by them can be jumbled up and still the prog ram should be able to rearrange the sequence of words to determine if the words follow the rule or not, for ex: If archaeologist enter words : arm, mad, king, doctor, rack, goat Then the program should check that these words follow the rule or not even by re arranging the sequence in which the words were originally entered. So for the above mentioned input the program should output Door can be opened As by rearranging the words the sequence arm mad doctor rack king goat follow the rule. NOTE : 1) All the words are in lower case letters and no special characters or n umeric characters are allowed. 2) Please make necessary assumptions where ever required. INPUT : * The number of test cases T ( 0


Comments

Copyright © 2021 UPDOCS Inc.