728x90
Above is the link to the problem.
Problem
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
You must implement a solution with a linear runtime complexity and use only constant extra space.
Example :
Input: nums = [4,1,2,1,2]
Output: 4
I solved this problem by the below code.
This code get the top 71.42% of the time efficiency and use 16.5 MB of memory.
728x90
반응형
'Code > LeetCode' 카테고리의 다른 글
[LeetCode] 169. Majority Element (Easy/Python) (0) | 2022.10.05 |
---|---|
[LeetCode] 168. Excel Sheet Column Title (Easy/Python) (1) | 2022.09.29 |
[LeetCode] 125. Valid Palindrome (Easy/Python) (0) | 2022.09.25 |
[LeetCode] 121. Best Time to Buy and Sell Stock (Easy/Python) (1) | 2022.09.23 |
[LeetCode] 88. Merge Sorted Array (Easy/Python) (0) | 2022.09.17 |