TLE
change to use left and right, use lInterval instead of mid, Still TLE
all changed to c, malloc is used to replace new. This slove the TLE