When I ran your code I printed the values of all the variables in the for statement thus:
k: 2 > i: 0) && ((nums[k]!=0: 0)||(nums[k]==0 && k==numsSize-1: 4
which shows:
k: 2
i: 0
nums[k]: 0
numsSize: 4
which means the first attempt to run the statement fails because the for expression is false. Hence the function returns immediately.