diff options
author | Jack Sangdahl <[email protected]> | 2024-10-29 19:26:36 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2024-10-29 19:26:36 -0600 |
commit | bf0ef281bee5004aee7ac459d42d7bab526c6d8a (patch) | |
tree | 287fafbd799efa38c4779b7a35cf8e2a58286d81 /misc.cpp | |
parent | 7559cb9c4ca06e6d2dad7b5353faf23fa1852004 (diff) | |
download | leetcode-bf0ef281bee5004aee7ac459d42d7bab526c6d8a.tar.gz leetcode-bf0ef281bee5004aee7ac459d42d7bab526c6d8a.zip |
987. vertical order traversal of a binary tree
Diffstat (limited to 'misc.cpp')
-rw-r--r-- | misc.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/misc.cpp b/misc.cpp deleted file mode 100644 index 8263244..0000000 --- a/misc.cpp +++ /dev/null @@ -1,20 +0,0 @@ -class Solution { -public: - vector<string> removeSubfolders(vector<string> &folder) { - sort(folder.begin(), folder.end()); - vector<string> res; - - for (auto s : folder) { - if (res.size() == 0) { - res.push_back(s); - continue; - } - - string parent = res[res.size() - 1]; - if (s.substr(0, parent.size() + 1) != parent + '/') - res.push_back(s); - } - - return res; - } -}; |