feat: add is_anagram to dsa

This commit is contained in:
rzmk 2024-03-05 15:55:21 -05:00
parent 1f32820941
commit b46a066dfc
No known key found for this signature in database
4 changed files with 127 additions and 4 deletions

View file

@ -37,7 +37,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {
"vscode": {
"languageId": "rust"
@ -50,7 +50,7 @@
"true"
]
},
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@ -58,6 +58,37 @@
"source": [
"dsa::contains_duplicate(vec![1, 3, 4, 2, 4])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 242. Valid Anagram"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"data": {
"text/plain": [
"true"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dsa::is_anagram(\"marc\".to_owned(), \"cram\".to_owned())"
]
}
],
"metadata": {