runtime error on leetcode but everything is fine on my own laptop