Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/doocs/leetcode
/ find132pattern
Method
find132pattern
solution/0400-0499/0456.132 Pattern/Solution.py:2–11 ·
view source on GitHub ↗
(self, nums: List[int])
Source
from the content-addressed store, hash-verified
1
class
Solution:
2
def
find132pattern(self, nums: List[int]) -> bool:
3
vk = -inf
4
stk = []
5
for
x in nums[::-1]:
6
if
x < vk:
7
return
True
8
while
stk and stk[-1] < x:
9
vk = stk.pop()
10
stk.append(x)
11
return
False
Callers
nothing calls this directly
Calls
2
pop
Method · 0.45
append
Method · 0.45
Tested by
no test coverage detected