File: root - text - article - 2019 - 10 - find-the-non-duplicate-number.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 543 Views, 22908 Search Bots | 60 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 543 Views, 22908 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 | 543 Views, 22908 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: Largest BST in a Binary Tree
- YES!!
- Daily Interview Problem: Look and Say Sequence
- [Daily Problem] Validate Balanced Parentheses
- Spectrum Master
- [Daily Problem] Move Zeros
- Daily Interview Problem: Maximum Profit From Stocks
- Algorithm Interview: No Adjacent Repeating Characters
- Algorithm Interview: Smallest Number that is not a Sum of a Subset of List
- CVE-2015-8874 - cPanel EasyApache Vulnerabilities
©2006~2024 SteakOverCooked - 0.00751 Seconds(s) - 2488.915 KB/s - 13 Online Memory: 492.61 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" />
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 !