@@ -0,0 +1,1083 @@
+package org.pilgrim.leetcode.y2022;%0A%0Aimport java.util.Stack;%0A%0Apublic class Pattern132 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Pattern132 pattern132 = new Pattern132();%0A        int%5B%5D input = %7B3,1,4,2%7D;%0A        boolean res = pattern132.find132pattern(input);%0A        %0A        System.out.println(res);%0A    %7D%0A%0A    public boolean find132pattern(int%5B%5D nums) %7B%0A        if (nums.length %3C 3) %7B%0A            return false;%0A        %7D%0A        Stack%3CInteger%3E stack = new Stack%3C%3E();%0A%0A        int%5B%5D min = new int%5Bnums.length%5D;%0A        min%5B0%5D = nums%5B0%5D;%0A        for (int i = 1; i %3C nums.length; i++) %7B%0A            min%5Bi%5D = Math.min(min%5Bi - 1%5D, nums%5Bi%5D);%0A        %7D%0A%0A        for (int j = nums.length - 1; j %3E= 0; j--) %7B%0A            if (nums%5Bj%5D %3E min%5Bj%5D) %7B%0A                while (!stack.isEmpty() && stack.peek() %3C= min%5Bj%5D) %7B%0A                    stack.pop();%0A                %7D%0A%0A                if (!stack.isEmpty() && stack.peek() %3C nums%5Bj%5D) %7B%0A                    return true;%0A                %7D%0A%0A                stack.push(nums%5Bj%5D);%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A%7D%0A

Add 132 Pattern