-
137. Single Number IIAlgorithm/python tip 2021. 3. 1. 17:56
leetcode.com/problems/single-number-ii/
class Solution(object): def singleNumber(self, nums): dic = {k: 0 for k in nums} for k in nums: dic[k] += 1 print(dic) for k, v in dic.items(): if v == 1: return k
'Algorithm > python tip' 카테고리의 다른 글
1732. Find the Highest Altitude (0) 2021.03.01 1679. Max Number of K-Sum Pairs (0) 2021.03.01 set을 만들지 않고 list 차집합 구하기(for in if not in) (0) 2021.03.01 1726. Tuple with Same Product (0) 2021.03.01 1765. Map of Highest Peak (0) 2021.03.01