Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 040085f

Browse files
refactor 456
1 parent 9c5e627 commit 040085f

File tree

1 file changed

+0
-28
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-28
lines changed

src/main/java/com/fishercoder/solutions/_456.java

-28
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,6 @@
22

33
import java.util.Deque;
44
import java.util.LinkedList;
5-
/**
6-
* 456. 132 Pattern
7-
*
8-
* Given a sequence of n integers a1, a2, ..., an,
9-
* a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj.
10-
* Design an algorithm that takes a list of n numbers as input and checks whether there is a 132 pattern in the list.
11-
12-
Note: n will be less than 15,000.
13-
14-
Example 1:
15-
Input: [1, 2, 3, 4]
16-
17-
Output: False
18-
19-
Explanation: There is no 132 pattern in the sequence.
20-
Example 2:
21-
Input: [3, 1, 4, 2]
22-
23-
Output: True
24-
25-
Explanation: There is a 132 pattern in the sequence: [1, 4, 2].
26-
Example 3:
27-
Input: [-1, 3, 2, 0]
28-
29-
Output: True
30-
31-
Explanation: There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
32-
*/
335

346
public class _456 {
357

0 commit comments

Comments
 (0)