File: root - text - article - 2019 - 12 - min-range-needed-to-sort.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 644 Views, 19756 Search Bots | 70 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 644 Views, 19756 Search Bots | 70 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by Twitter:
Given a list of integers, return the bounds of the minimum range that must be sorted so that the whole list would be sorted.
Example:
Input: [1, 7, 9, 5, 7, 8, 10]
Output: (1, 5)
Explanation:
The numbers between index 1 and 5 are out of order and need to be sorted.
Here's your starting point:
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 644 Views, 19756 Search Bots | 70 Words Given a list of integers, return the bounds of the minimum range that must be sorted so that the whole list would be sorted.
Example:
Input: [1, 7, 9, 5, 7, 8, 10]
Output: (1, 5)
Explanation:
The numbers between index 1 and 5 are out of order and need to be sorted.
Here's your starting point:
def findRange(nums):
# Fill this in.
print findRange([1, 7, 9, 5, 7, 8, 10])
# (1, 5)
Related Articles
- Daily Interview Problem: Running Median
- Daily Interview Problem: Deepest Node in a Binary Tree
- Daily Interview Problem: Trapping Rainwater
- Maximum In A Stack
- Algorithm Interview: Shifted String
- Daily Interview Problem: Contiguous Subarray with Maximum Sum
- Sorting a list with 3 unique numbers
- Daily Interview Problem: Min Stack
- Daily Interview Problem: Merge Overlapping Intervals
- Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
©2006~2024 SteakOverCooked - 0.00823 Seconds(s) - 2335.681 KB/s - 44 Online Memory: 492.44 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 !