Python Leetcode Notes
- Map tuple to list in a set
[*map(list,ans)] # ans is a set of tuples
- get the value of a key in dict and return other value if it is not there
seen.get(n, -1) # seen is a dict. If n is in seen, then return seen[n], otherwise -1.
- Divide by 2 and take the integer part
aaa = aaa >> 1 # method 1
aaa = aaa // 2 # method 2