Skip to content

Commit

Permalink
18-InSange
Browse files Browse the repository at this point in the history
  • Loading branch information
InSange committed Jul 10, 2024
1 parent 9e7dc6e commit efcb945
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions InSange/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
---
21 changes: 21 additions & 0 deletions InSange/๋ฌธ์ž์—ด/1598_Crawler Log Folder.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
int minOperations(vector<string>& logs) {
int height;

height = 0;

for (auto str : logs)
{
if (str[0] != '.') height++;
else if (str == "../") height = (height ? height - 1 : 0);
}

return height;
}
};

0 comments on commit efcb945

Please sign in to comment.