File: root - text - article - 2019 - 10 - find-the-non-duplicate-number.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 305 Views, 18245 Search Bots | 60 Words
| Browse | Archive
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 305 Views, 18245 Search Bots | 60 Words
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
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 | 305 Views, 18245 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.
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Related Articles
- Autorun.inf Virus Protection
- Top K Frequent words
- Floor and Ceiling of a Binary Search Tree
- CPU Utilization
- Daily Interview Problem: Buddy Strings
- Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
- First and Last Indices of an Element in a Sorted Array
- Binary Tree Level with Minimum Sum
- Daily Interview Problem: Decode String
- Daily Interview Question: Create a Simple Calculator
©2006~2024 SteakOverCooked - 0.02435 Seconds(s) - 767.348 KB/s - 11 Online
Memory: 494.38 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="noindex, follow" />
![](/images/top.jpg)
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !