Single Number Leetcode Python Questions For Loops In R