Skip to content

Create subarray-sum-equals-k.md#7

Open
tshimosake wants to merge 1 commit intomasterfrom
tshimosake-patch-5
Open

Create subarray-sum-equals-k.md#7
tshimosake wants to merge 1 commit intomasterfrom
tshimosake-patch-5

Conversation

@tshimosake
Copy link
Owner

def subarraySum(self, nums: List[int], k: int) -> int:
res = 0
for index, num in enumerate(nums):
sum = 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build-in な名前はできれば使いません。
https://docs.python.org/3/library/functions.html

for index, num in enumerate(nums):
sum = 0
j = 0
while index + j <= len(nums) - 1:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

< len(nums) のほうが普通でしょう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants