Exercise #160: Medium Type Lookup
Type Challenges (Utility Types) ยท 03-medium
Goal

Goal: Sometimes, you may want to lookup for a type in a union by their attributes. In this challenge, we would like to get the corresponding type by searching for the common `type` field in the union `Cat | Dog`. In other words, we will expect to get `Dog` for `LookUp<Dog | Cat, 'dog'>` and `Cat` for `LookUp<Dog | Cat, 'cat'>` in the following example: Source challenge: https://github.com/type-challenges/type-challenges/tree/main/questions/00062-medium-type-lookup Reference explanation: https://github.com/ghaiklor/type-challenges-solutions/blob/main/en/medium-type-lookup.md

Run "Check Solution" to validate your code in the browser.