Check If N and Its Double Exist
Input: arr = [10,2,5,3]
Output: true
Explanation: N = 10 is the double of M = 5,that is, 10 = 2 * 5.class Solution:
def checkIfExist(self, arr: List[int]) -> bool:
count = collections.Counter(arr)
for i in arr:
if count[i*2] and i != 0 or count[0] > 1 :
return True
return FalseLast updated