Skip to content

Commit 29626b4

Browse files
committed
misc
1 parent 13d6319 commit 29626b4

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

my-submissions/e1800.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def maxAscendingSum(self, nums: List[int]) -> int:
3+
curr = []
4+
summ = 0
5+
maxx = 0
6+
for num in nums :
7+
if curr and curr[-1] >= num :
8+
maxx = max(maxx, summ)
9+
summ = 0
10+
curr = []
11+
curr.append(num)
12+
summ += num
13+
return max(maxx, summ)

my-submissions/m2393.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution:
2+
def countSubarrays(self, nums: List[int]) -> int:
3+
curr = []
4+
output = 0
5+
indx = 0
6+
7+
for num in nums :
8+
if curr and curr[-1] >= num :
9+
curr = []
10+
curr.append(num)
11+
output += len(curr)
12+
indx += 1
13+
14+
return output

0 commit comments

Comments
 (0)