dave on Nostr: fn common_char_functional(str1: &str, str2: &str) -> Vec<char> { str1.chars() ...
fn common_char_functional(str1: &str, str2: &str) -> Vec<char> {
str1.chars()
.filter(|ch1| str2.contains(*ch1))
.collect()
}
Published at
2023-02-10 07:46:26Event JSON
{
"id": "49c3e6ee9e6521768418fdd7d1ea964d7412f91c7d34926c74745df0f12eac18",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1676015186,
"kind": 1,
"tags": [
[
"e",
"cf6ec50761a809a533e32de590d94eacd78c544265a3f67e215836d468ad9df5",
"",
"root"
],
[
"e",
"faca5a9be65c4dd96e1fa6766a17467a017ab43569918c22d934f87d3c8f55ef",
"",
"reply"
],
[
"p",
"07df91ae471e765c996d5bd1f16be175c83eb2f6efdc5c9aa7503309dc7872ee"
]
],
"content": "fn common_char_functional(str1: \u0026str, str2: \u0026str) -\u003e Vec\u003cchar\u003e {\n str1.chars()\n .filter(|ch1| str2.contains(*ch1))\n .collect()\n}",
"sig": "2c3099170f7c8a91ba76cf503a09cda65b47d909c15e2ac2ae2bc4aae1e3f08314f837487d503abf982fec2bb0fe6ef36fbd4047c9d0335dc4c154ea1140b73c"
}