To the Top
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 | 404 Views, 16779 Search Bots | 70 Words

Subscribe to Feed Burner | 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:


def findRange(nums):
# Fill this in.

print findRange([1, 7, 9, 5, 7, 8, 10])
# (1, 5)
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 404 Views, 16779 Search Bots | 70 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Question: Find Cycles in a Graph
  2. Spreadsheet Column Title
  3. Batch Programming in XP
  4. Design Tic-Tac-Toe
  5. Algorithm Interview: Make the Largest Number
  6. Daily Interview Problem: Word Ordering in a Different Alphabetical Order
  7. ImageMagick Vulnerabilities -  CVE-2016–3714
  8. Linode Support Ticket 10029540 - Other - Important Notice Regarding Ubuntu 17.10 Image
  9. Sorting a list with 3 unique numbers
  10. [Daily Problem] Longest Palindromic Substring

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />