Homework for algo course