文件: root - text - article - 2019 - 10 - find-the-non-duplicate-number.txt
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | 英文 | 主页 | 类别: 计算机科学 | 522 次阅读, 21660 次搜索 | 60 个单词
| 浏览 | 博客存档
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | 英文 | 主页 | 类别: 计算机科学 | 522 次阅读, 21660 次搜索 | 60 个单词
| 浏览 | 博客存档
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.
标签: 每日算法题, 算法, 数据结构, 面试题, Daily Problem, Data Structures and Algorithms, | 英文 | 主页 | 类别: 计算机科学 | 522 次阅读, 21660 次搜索 | 60 个单词 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.
猜您喜欢...
- CVE-2015-8874 - cPanel EasyApache Vulnerabilities
- How to Play WAV music under DOS?
- Sorting a list with 3 unique numbers
- Find the non-duplicate number
- Daily Interview Problem: Minimum Removals for Valid Parenthesis
- Daily Interview Problem: Given two arrays, write a function to compute their intersection.
- Daily Interview Problem: Merge K Sorted Linked Lists
- Daily Interview Question: Word Search
- Daily Interview Puzzle: Intersection of Linked Lists
- Daily Interview Problem: Reverse Integer
©2006~2024 牛排过熟 - 0.00869 秒 - 6256.676 KB/s - 48 在线 内存: 516.52 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
牛排怎么做才好吃? | <meta name="机器人" content="不索引, 跟踪" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - 服务器 PHP 版本号: 7.4.33
评论 (0)
读写完全 - 一般 - 最小 - 表格 - 所有评论 - 统计
当前页暂时没有评论。