My take on weekly algorithm problems on interview cake