correct the wrong solution but time limit exceeded -- updated in Millbrae, CA