File: root - text - article - 2019 - 10 - find-the-non-duplicate-number.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 523 Views, 21661 Search Bots | 60 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | English | Home Page | Category: Computing | 523 Views, 21661 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 | 523 Views, 21661 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: Get all Values at a Certain Height in a Binary Tree
- Daily Interview Problem: Min Range Needed to Sort
- Sort a Partially Sorted List
- Daily Interview Problem: Room scheduling
- Algorithm Interview: Determine If Linked List is Palindrome
- Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
- Daily Interview Problem: Largest BST in a Binary Tree
- Daily Interview Problem: Count Number of Unival Subtrees
- Reverse a Directed Graph
- Fix Brackets
©2006~2024 SteakOverCooked - 0.00722 Seconds(s) - 2602.092 KB/s - 37 Online Memory: 491.56 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 !