diff --git a/InSange/README.md b/InSange/README.md index acd9934..b618d53 100644 --- a/InSange/README.md +++ b/InSange/README.md @@ -19,4 +19,5 @@ | 15차시 | 2024.05.27 | 정렬 | [통나무 건너뛰기](https://www.acmicpc.net/problem/11497) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/57)] | 16차시 | 2024.06.28 | 그래프 | [Maximum_Total_Importance_ofRoads](https://leetcode.com/problems/maximum-total-importance-of-roads/) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/63)] | 17차시 | 2024.06.28 | 문자열 | [Zigzag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [#17](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/64)] +| 18차시 | 2024.07.10 | 문자열 | [Crawler Log Folder](https://leetcode.com/problems/crawler-log-folder/) | [#18](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/64)] --- diff --git "a/InSange/\353\254\270\354\236\220\354\227\264/1598_Crawler Log Folder.cpp" "b/InSange/\353\254\270\354\236\220\354\227\264/1598_Crawler Log Folder.cpp" new file mode 100644 index 0000000..0e2c634 --- /dev/null +++ "b/InSange/\353\254\270\354\236\220\354\227\264/1598_Crawler Log Folder.cpp" @@ -0,0 +1,21 @@ +#include +#include + +using namespace std; + +class Solution { +public: + int minOperations(vector& logs) { + int height; + + height = 0; + + for (auto str : logs) + { + if (str[0] != '.') height++; + else if (str == "../") height = (height ? height - 1 : 0); + } + + return height; + } +}; \ No newline at end of file