超时的快慢指针,可是超时了。。呜呜呜
int singleNonDuplicate(int* nums, int numsSize){ //快慢指针,如果前一位与当前一位相等,那把fast赋值给slow,进行前移 int slow=0,fast=1; int ans=0; int len=numsSize; if(len==1) { return nums[0]; } while(slow
int singleNonDuplicate(int* nums, int numsSize){ for(int i=0;i
int singleNonDuplicate(int* nums, int numsSize){ int left=0; int right=numsSize; while(left