aboutsummaryrefslogtreecommitdiff
path: root/backspace_string_compare.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
committerJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
commit55a67f776dd9acd258cae16ffb636751666b0f40 (patch)
tree601539de43809b70ceb8228a12c35883fa300b03 /backspace_string_compare.cpp
parenta0030873dabb517594ae0394350d6715071f7fb8 (diff)
downloadleetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz
leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip
chore: Remove incomplete solutions
Diffstat (limited to 'backspace_string_compare.cpp')
-rw-r--r--backspace_string_compare.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/backspace_string_compare.cpp b/backspace_string_compare.cpp
deleted file mode 100644
index 110e469..0000000
--- a/backspace_string_compare.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- bool backspaceCompare(string s, string t) {
- int k = 0, p = 0;
- for (int i = 0; i < s.size(); i++) {
- if (s[i] == '#') {
- k--;
- k = max(0, k);
- } else {
- s[k] = s[i];
- k++;
- }
- }
- for (int i = 0; i < t.size(); i++) {
- if (t[i] == '#') {
- p--;
- p = max(0, p);
- } else {
- t[p] = t[i];
- p++;
- }
- }
- if (k != p)
- return false;
- else {
- for (int i = 0; i < k; i++)
- if (s[i] != t[i])
- return false;
- return true;
- }
- }
-};
-
-int main() {}