You will be given an input with a large series of lines (all strings). The first line consists of 2 integer values, x and y, which will tell you the number of following lines (evidence) and the size of the hash table respecitvely. Following that will be x lines with three numbers: a, b, and c. a represents an integer to be inserted into the hash table, b represents the first potential hash position, and c represents a second valid hash position. If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else, return the string "Drat!".
please don't use chegg
You are a up-and-coming detective at the ACPD (Avian Cuculinae Police Department) for Nestville City, and have just been placed on the case for the Cuckoo Killer. You arrive at three new crime scenes and have a plethora of potential evidence to collect, but with little time until they strike again you need to be absolutely sure the only crime scenes you investigate were done by the Cuckoo Killer. Thankfully, they leave a signature mark on the scene: precisely reorganizing the environment into integers and hash functions able to produce valid Cuckoo Hashes (a lucky break!).
You will be given an input with a large series of lines (all strings). The first line consists of 2 integer values, x and y, which will tell you the number of following lines (evidence) and the size of the hash table respecitvely. Following that will be x lines with three numbers: a, b, and c. a represents an integer to be inserted into the hash table, b represents the first potential hash position, and c represents a second valid hash position. If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else, return the string "Drat!".
Step by step
Solved in 2 steps