I have one more check in the code as
if(duration==1) return ts.size();
and this make my code failed in the last test case (my output 10000, correct answer 9926).
Anybody can help me figure out why I'm wrong here?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.