Question 1:
Given software name (string[] array) and it's corresponding version number (int[] array), design an efficient algorithm to find the highest version based on any provided software name.
For example: you may receive, ["iOS", "Google Doc", "iOS", "Windows", "Google Doc"] and its corresponding versions are [11, 3, 5, 3, 6]. If you search for "iOS" the output must be 11 not 5.
Question 2:
Let's say you're an environmental engineer trying to assist in laying out infrastructure in some village. The village has N houses, each which needs a water supply. A house can receive water if:
You work with a contractor and figure out
What's the cheapest way to make sure every house in the village is connected to a water supply?