Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Array_String/238. Product of Array Except Self/soorajs1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution:
def productExceptSelf(self, nums: List[int]) -> List[int]:
l = len(nums)
out = [1]*l
a = 1
for i in range(1, l):
out[i] = out[i-1]*nums[i-1]
for i in range(l-1, -1, -1):
out[i] = out[i]*a
a *= nums[i]
return out
15 changes: 15 additions & 0 deletions Array_String/334. Increasing Triplet Subsequence/soorajs1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
if len(nums) < 3:
return False
else:
a = 10**10
b = 10**10
for i in nums:
if i < a:
a = i
elif i > a and i < b:
b = i
if i > b:
return True
return False