diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2023-04-09 03:09:19 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2023-04-09 03:09:19 +0200 |
| commit | c827efeeef0cdc63c5366e9d945fa53c09988491 (patch) | |
| tree | e33361fa13742f5fd295e1e8525f388fca7fdda4 /2022/Cpp/Day7/youssef.cpp | |
| parent | d5e8f8cb89c24e02898eed760ea22f0522e59f44 (diff) | |
| download | aoc-c827efeeef0cdc63c5366e9d945fa53c09988491.tar.xz aoc-c827efeeef0cdc63c5366e9d945fa53c09988491.zip | |
Solve day7 in rust
Diffstat (limited to '2022/Cpp/Day7/youssef.cpp')
| -rwxr-xr-x | 2022/Cpp/Day7/youssef.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/2022/Cpp/Day7/youssef.cpp b/2022/Cpp/Day7/youssef.cpp new file mode 100755 index 0000000..70daea0 --- /dev/null +++ b/2022/Cpp/Day7/youssef.cpp @@ -0,0 +1,51 @@ +#include <bits/stdc++.h> + +using namespace std; + +class Dir { +private: + string name; + vector<Dir *> dir_list; + unsigned int size; + bool is_file; + +public: + Dir(string _name, unsigned int _size = 0) { + this->name = _name; + this->size = _size; + + this->is_file = true; + if (_size == 0) { + this->is_file = false; + } + } + + void add(Dir *dir) { + dir_list.emplace_back(dir); + } +}; + +class FileSystem { +private: + Dir root_dir; + map<string, Dir> map_dir; + +public: + void add_to_dir(string path, Dir* dir) { + map_dir[path].add(dir); + } + + void create_dir(string path, Dir dir) { + if (!map_dir.count(path)) { + map_dir[path] = dir; + } + } +}; + +void read_input() { + string cur_dir = ""; +} + +int main() { + return 0; +} |
