Skip to content

Commit aa90224

Browse files
committed
做了道题
1 parent 450df33 commit aa90224

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,5 +1236,20 @@ def leftRightDifference(self, nums: List[int]) -> List[int]:
12361236
ans = [abs(left[i] - right[i]) for i in range(n)]
12371237
return ans
12381238

1239+
def divisibilityArray(self, word: str, m: int) -> List[int]:
1240+
col = ""
1241+
ans = []
1242+
for i in range(len(word)):
1243+
col += word[i]
1244+
if int(col) % m == 0:
1245+
ans.append(1)
1246+
col = ""
1247+
else:
1248+
ans.append(0)
1249+
return ans
1250+
1251+
def maxNumOfMarkedIndices(self, nums: List[int]) -> int:
1252+
1253+
12391254
s = Solution()
12401255
print(s.maxTotalReward( [1,6,4,3,2]))

0 commit comments

Comments
 (0)