Compute total time to finish all courses | Snowflake Interview Question