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 | 336 Views, 15003 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 | 336 Views, 15003 Search Bots | 70 Words Subscribe to Feed Burner

Related Articles

  1. Design Tic-Tac-Toe
  2. Palindrome Integers
  3. Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
  4. Daily Interview Problem: Get all Values at a Certain Height in a Binary Tree
  5. [Daily Problem] Longest Increasing Subsequence
  6. Daily Interview Puzzle: Minimum Size Subarray Sum
  7. Daily Interview Question: Create a Simple Calculator
  8. Two Tricks of Delphi
  9. Top K Frequent words
  10. Delphi Dynamic Array

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

    Be the first one to comment this page !


Page Edited: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />