# 忽略顺序-判断两个串是否一样

```python
import collections


class Solution:
    """
    @param s: The first string
    @param b: The second string
    @return true or false
    """

    def anagram(self, s, t):
        cs = collections.Counter(s)
        ct = collections.Counter(t)
        return cs == ct


class Solution2:

    def anagram(self, s, t):
        return sorted(s) == sorted(t)


s = Solution()
a = s.anagram('abcdeee', 'eeeadcb')
print(a)

s2 = Solution2()
a2 = s2.anagram('abcdeee', 'eeeadcb')
print(a2)

'''
True
True
'''
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://im-qianuxn.gitbook.io/pytorch/ji-suan-ji/shua-ti/sou-suo-cha-zhao-lei/pan-duan-liang-ge-chuan-shi-fou-yi-yang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
