Intuition
(A) zip the names and corresponding heights (B) sort array with respect to the heights (C) return only the names
Code
Python3
Big O Analysis
-
Runtime
The runtime complexity here is since are sorting list of length N.
-
Memory
The memory usage is since we use functions like
zip
andsorted
which return lists of length N.
— A