Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 365 Bytes

File metadata and controls

16 lines (13 loc) · 365 Bytes

Sub Sort

Given an array of integers, write a method to find indices m and n such that if you sorted elements m through n, the entire array would be sorted. Minimize n - m (that is, find the smallest such sequence).

Solutions:

Swift

O(n)

C++

O(n)

Installation

Run make to build and run Swift files. Or you can run .playground file.