forked from Srinivas11789/AlgorithmNuggets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path132.py
More file actions
32 lines (21 loc) · 651 Bytes
/
132.py
File metadata and controls
32 lines (21 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Pending...
class Solution(object):
def find132pattern(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
# Attemp 1 - Brute Force Solution - Time limit exceeded
n = len(nums)
i = 0
while i < n:
j = i + 1
while j < n:
k = j + 1
while k < n:
if i < j < k and nums[i] < nums[k] < nums[j]:
return True
k += 1
j += 1
i += 1
return False