Solution
Note that a connection tester consists of a battery, a light bulb, and a few short wires, and that "connected" is an equivalence relation
Leave 1 unconnected at the bottom, link 2 and 3 together, 4-6 together, 7-10 together, etc., so that we have "equivalence classes" of connection for sizes 1, 2, 3, 4, 5, and 6.
Now go to the top of the list and find out which letters are associated with nothing, one other letter, two others, and so on until you've determined the equivalence classes.
Connect the initial letters of each equivalence class (there are six) in a new equivalence class, the second from each (5 of them) in a new equivalence class, and so on. Remove the old links at the bottom and find out the new equivalence classes in the same way.
We now know what groups of n letters (for n=1 to 6) at the top correlate to what groups of n numbers at the bottom, due to the first set of classes. We now know which letters and numbers were the "first" in their original classes, which were the "second," and so on, thanks to the second set of classes.
This technique works well for any triangle number of wires, and it's simple to modify to work for all natural numbers greater than 2.
Check out this problem - 8 Queens Problem
Frequently Asked Questions
What are analytical skills?
Analytical abilities allow you to recognize the complexity of a problem, analyze and organize it, solve it, make projections, and generate new ideas. Making accurate assessments of events and offering insight into how various components interact is what analytical thinking entails. As a result, analytical skills are highly directed toward understanding cause and effect and forecasting the implications of possible solutions.
Why do we do puzzles in interviews?
Usually, interviewers ask for puzzles to see how you go about solving a tricky problem. Most companies avoid asking it because most puzzles hinge on a single trick that a person can easily miss when he is having a bad or nervous day.
What is a puzzle interview?
Microsoft popularized the puzzle interview in the 1990s. Puzzle interviews ask the applicant to solve puzzles like "Why are manhole covers round?" or unusual problems like, "How would you weigh an airplane without a scale?".
What are some of the most typical puzzles posed during an interview?
Some of the most popular interview puzzles are:
- Crossing the Bridge Puzzle
- Man Fell in Well Puzzle
- The Man in the Elevator Puzzle
- Heaven or Hell Puzzle
- Three Mislabeled Jars
- Gold Bar Cut Puzzle
- Horses on a Race Track Puzzle
- Min elevator Trips
Will puzzles be asked in interviews all the time?
While most interviewers do not usually ask for puzzles, they are relatively frequent, and some interviews may even include specialized puzzle-solving parts. It's always a good idea to be prepared in case something happens
Conclusion
This article discussed Min Elevator Trips along with their solution. It requires some out-of-the-box thinking to solve min elevator trips puzzle.
Recommended Readings:
Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.
Also check out some of the Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.
Happy Learning!!