Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Shortest Unsorted Continuous Subarray

2

@haruhiku I like you(joke) and esp u ANSWER!!! hhhh _

P

it's a easy question. I Will choose the naïve solution. Awesome job Buddy

L

I think we don't need two loops, we can do it in one loop like this.

@waigx Interesting solution.

@i_square I appreciate you idea, and I think it is the best.

@alexander The first solution is easy to think of. And the second solution is awesome to solve problem in O(n) space and O(n) time. Thank you for your post!

N

@waigx I am in the same situation. Wondering if the runtime is related to condition of your computer...

H

@Hao-Cai Thank you ! that's really elaborate~It's an unique solution,I understand it completely ~

@kromah find the begin and end of the sub array

B

Thats smart ! is complexity O(n.logn)?

S

@jaqenhgar shorter writing style for same algorithm

No one has replied

Disabled Categories are greyed out

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.