Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 2206 python #769

Merged
merged 7 commits into from
Mar 24, 2022
Merged

update 2206 python #769

merged 7 commits into from
Mar 24, 2022

Conversation

ShengyuanWang
Copy link
Member

python3 solution for leetcode 2206 problem

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Yang Libin <contact@yanglibin.info>
@ShengyuanWang ShengyuanWang requested a review from yanglbme March 24, 2022 06:19
@yanglbme
Copy link
Member

三个文件都要改一下

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@yanglbme
Copy link
Member

帮你简化一下写法,更加 Pythonic,同时不影响可读性

class Solution:
    def divideArray(self, nums: List[int]) -> bool:
        cnt = Counter(nums)
        return all(v % 2 == 0 for v in cnt.values())

@yanglbme yanglbme merged commit d421285 into doocs:main Mar 24, 2022
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.

None yet

2 participants