File: root - text - article - 2019 - 10 - find-the-non-duplicate-number.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 524 Views, 21756 Search Bots | 60 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 524 Views, 21756 Search Bots | 60 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by Facebook:
Given a list of numbers, where every number shows up twice except for one number, find that one number.
Example:
Input: [4, 3, 2, 4, 1, 3, 2]
Output: 1
Here's the function signature:
Challenge: Find a way to do this using O(1) memory.
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Cateogry: Computing | 524 Views, 21756 Search Bots | 60 Words Given a list of numbers, where every number shows up twice except for one number, find that one number.
Example:
Input: [4, 3, 2, 4, 1, 3, 2]
Output: 1
Here's the function signature:
def singleNumber(nums):
# Fill this in.
print singleNumber([4, 3, 2, 4, 1, 3, 2])
# 1
Challenge: Find a way to do this using O(1) memory.
Related Articles
- Daily Interview Problem: Reconstrunct Binary Tree from Preorder and Inorder Traversals
- Find Pythagorean Triplets
- Floor and Ceiling of a Binary Search Tree
- A trick for getting good at coding interviews FASTER
- Daily Interview Problem: Tree Serialization
- Daily Interview Problem: Reverse Integer
- Absolute Path
- [Daily Problem] Longest Palindromic Substring
- Daily Interview Problem: Merge List Of Number Into Ranges
- Daily Interview Problem: Decode String
©2006~2024 SteakOverCooked - 0.00963 Seconds(s) - 2004.854 KB/s - 22 Online Memory: 492.95 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="index, follow">
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !