β back to unit
Easy
# sorting easy
Shortest to Tallest?
Class photo time β line up shortest to tallest! The twins are the same height, and that's fine. πΈ
You get the line as heights. Print say cheese if nobody is shorter than the kid before them, otherwise keep shuffling.
Example:
Input: heights = [120, 130, 130, 141]
Output: say cheese
Nobody is shorter than the kid before them β the repeated 130 is fine, since equal heights are allowed. Print say cheese.
π‘ need a hint?
sort-shortest-to-tallest.pyπ given lines are locked β write your code in between
loading...