MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / check

Method check

Python/496_nextgreaterelement.py:2–7  ·  view source on GitHub ↗
(self, number, nums1, nums2)

Source from the content-addressed store, hash-verified

1class Solution:
2 def check(self, number, nums1, nums2):
3 index = nums2.index(number)
4 for _ in range(index, len(nums2)):
5 if(nums2[_]>number):
6 return nums2[_]
7 return -1
8
9 def nextGreaterElement(self, nums1: List[int], nums2: List[int]) -> List[int]:
10 return [self.check(x, nums1, nums2) for x in nums1]

Callers 1

nextGreaterElementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected