Maximize profit with bounded sell window | Microsoft Interview Question