题解 | #牛群构成判断# 字符串
牛群构成判断
https://www.nowcoder.com/practice/b7b8c4d6390146dabe52d78e9e7136c6
知识点
字符串
思路
对每个字符串的字符统计计数,如果完全相同则为真。实现上对字符串排序即可。
AC Code(python)
#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
#
# @param s string字符串
# @param t string字符串
# @return bool布尔型
#
class Solution:
def areHerdCompositionsEqual(self , s: str, t: str) -> bool:
return sorted(s) == sorted(t)


