feat: add dsa, update get_multiples_in_range, add rust notebook

This commit is contained in:
rzmk 2024-03-04 17:44:04 -05:00
parent f135bad4ad
commit 6a3f4cc7e4
No known key found for this signature in database
10 changed files with 287 additions and 98 deletions

80
notebooks/rust/dsa.ipynb Normal file
View file

@ -0,0 +1,80 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# ladderz dsa usage\n",
"\n",
"Here are some examples of using the `dsa` (data structures and algorithms) module from `ladderz`.\n",
"\n",
"> This notebook uses [evcxr](https://github.com/evcxr/evcxr) for a Rust Jupyter Kernel. See [the evcxr_jupyter README.md](https://github.com/evcxr/evcxr/blob/main/evcxr_jupyter/README.md) for more info on how to run this notebook on your machine."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [],
"source": [
"// Uncomment the next line and comment the subsequent line if not running notebook from source\n",
"// :dep ladderz = { git = \"https://github.com/rzmk/ladderz\", branch = \"main\" }\n",
":dep ladderz = { path = \"../../ladderz\" }\n",
"\n",
"use ladderz::dsa;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 217. Contains Duplicate"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"vscode": {
"languageId": "rust"
}
},
"outputs": [
{
"data": {
"text/plain": [
"true"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dsa::contains_duplicate(vec![1, 3, 4, 2, 4])"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Rust",
"language": "rust",
"name": "rust"
},
"language_info": {
"codemirror_mode": "rust",
"file_extension": ".rs",
"mimetype": "text/rust",
"name": "Rust",
"pygment_lexer": "rust",
"version": ""
}
},
"nbformat": 4,
"nbformat_minor": 2
}