Skip to content

Commit 2d04896

Browse files
committed
Runtime 33 ms (Top 68.95%) | Memory 13.0 MB (Top 40.73%)
1 parent 6dbf838 commit 2d04896

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public:
3+
bool makeStringsEqual(string s, string target) {
4+
if(s == target) return true;
5+
int count1=0,count2=0;
6+
for(int i=0;i<s.length();i++)
7+
if(s[i]=='0') count1++;
8+
if(count1==s.length()) return false;
9+
for(int i=0;i<target.length();i++)
10+
if(target[i]=='0') count2++;
11+
if(count2==target.length()) return false;
12+
return true;
13+
}
14+
};

0 commit comments

Comments
 (0)