Micro Trends Interview Question

Python coding problem with zero guidance