dave on Nostr: fn common_char(str1: &str, str2: &str) -> Vec<char> { let mut common_chars = vec![]; ...
fn common_char(str1: &str, str2: &str) -> Vec<char> {
let mut common_chars = vec![];
for ch1 in str1.chars() {
if str2.contains(ch1) {
common_chars.push(ch1);
}
}
common_chars
}
Published at
2023-02-10 07:44:06Event JSON
{
"id": "a1e8564384a19aefb755d8079b486769ba6d2dc302864f91f783efa27b55712e",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1676015046,
"kind": 1,
"tags": [
[
"e",
"cf6ec50761a809a533e32de590d94eacd78c544265a3f67e215836d468ad9df5",
"",
"reply"
],
[
"p",
"07df91ae471e765c996d5bd1f16be175c83eb2f6efdc5c9aa7503309dc7872ee"
]
],
"content": "fn common_char(str1: \u0026str, str2: \u0026str) -\u003e Vec\u003cchar\u003e {\n let mut common_chars = vec![];\n for ch1 in str1.chars() {\n if str2.contains(ch1) {\n common_chars.push(ch1);\n }\n }\n common_chars\n}",
"sig": "8c14da8ad22757b9640f68f64bcef2745da2bb92527463506dd553eea6a3493a60574d7141aefa68518c2ddd73e0e4f0a5581ff9dbd0d4dc8d7fc95db221365c"
}