Skip to content

Conversation

@Satorien
Copy link
Owner

```python
class Solution:
def minSubArrayLen(self, target: int, nums: List[int]) -> int:
minimal_length = 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.

minimal_ や minimum_number_of_ は、 min_ と略すことが多いように思います。他に

  • num_(number of)
  • sum_(sum of)
  • max_(maximum number of)

などもよく使うように思います。このあたりは、所属するチームの平均的な書き方に合わせることをおすすめします。

def minSubArrayLen(self, target: int, nums: List[int]) -> int:
minimal_length = len(nums) + 1
left = 0
window_sum = 0
Copy link

Choose a reason for hiding this comment

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

自分なら sum_nums または sum_nums_in_window と名付けると思いますが、趣味の範囲だと思います。

if minimal_length == len(nums) + 1:
return 0
return minimal_length
```

Choose a reason for hiding this comment

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

読みやすいです。

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.

4 participants