MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / is_anagram

Function is_anagram

242-valid-anagram.rs:1–7  ·  view source on GitHub ↗
(s: String, t: String)

Source from the content-addressed store, hash-verified

1pub fn is_anagram(s: String, t: String) -> bool {
2 let mut a = s.chars().collect::<Vec<char>>();
3 let mut b = t.chars().collect::<Vec<char>>();
4 a.sort();
5 b.sort();
6 a == b
7}
8
9fn main() {
10 let s = "rat".to_string();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected