package leetcode;

/**
 * https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
 */
public class Problem581 {
    public int findUnsortedSubarray(int[] nums) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem581 prob = new Problem581();
        System.out.println(prob.findUnsortedSubarray(new int[]{2, 6, 4, 8, 10, 9, 15})); // 5
    }
}

@@ -168,24 +168,25 @@
 nums) %7B%0A
+%0A
         
 // TODO%0A
@@ -181,15 +181,58 @@
     
-// TODO
+for (int i = 0; i %3C nums.length; i++) %7B%0A%0A        %7D
 %0A   
@@ -436,16 +436,113 @@
 ); // 5%0A
+        System.out.println(prob.findUnsortedSubarray(new int%5B%5D%7B2, 6, 4, 8, 10, 7, 9%7D)); // 6    %0A
     %7D%0A%7D%0A

Update problem 581