Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug Report for is-anagram #4249

Closed
Closed
@kelltom

Description

@kelltom

Bug Report forhttps://neetcode.io/problems/is-anagram

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.


Not enough test cases for this question. The tests only check character membership, not counts.

The following code passes all NeetCode tests:

classSolution:defisAnagram(self,s:str,t:str)->bool:iflen(s)!=len(t):returnFalsesetS=set(s)forcharint:ifcharnotinsetS:returnFalsereturnTrue

But it's actually invalid, since this input would fail:

s="aabb"t="abbb"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp