Skip to content

Bug Report for is-anagram #4742

@Chetan177

Description

@Chetan177

Bug Report for https://neetcode.io/problems/is-anagram

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

When I ran the solution for anagram is gives this error:

Image

Steps:

  • User following code
func isAnagram(s string, t string) bool {
    if len(s) != len(t) {
        return false
    }

    countS, countT := make(map[rune]int), make(map[rune]int)
    for i, ch := range s {
        countS[ch]++
        countT[rune(t[i])]++
    }

    for k, v := range countS {
        if countT[k] != v {
            return false
        }
    }
    return true
}
  • Run it

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