Back to problems

Multi-System Unit Conversion

Algorithm · Apple · Medium

You receive a list of conversion rules between units, followed by a list of conversion questions. The units do not all live in one connected family: they can split into several independent conversion systems (temperature units might make up one family while length units make up another), so no single unit serves as a universal base. Every rule is written as unitA unitB factor, and it states that one unitA equals factor units of unitB; in other words, $$1 \cdot \text{unitA} =…

Loading the rest of the question…