Implement local maxima, bagging, and k-means | TikTok Interview Question