在做leetcode 3Sum这道题时,发现如果写成whilenums[low] == nums[low + 1] and low<high:将会出现runtime error,具体原因如下图所示,即nums[low+1]将会出现溢出。
然而写成while low<high and nums[low] == nums[low + 1]:则显示成功。
难道意味着and运算不是两边同时进行的???
在做leetcode 3Sum这道题时,发现如果写成whilenums[low] == nums[low + 1] and low<high:将会出现runtime error,具体原因如下图所示,即nums[low+1]将会出现溢出。
然而写成while low<high and nums[low] == nums[low + 1]:则显示成功。
难道意味着and运算不是两边同时进行的???