Skip to content

Commit d630e93

Browse files
committed
Runtime 0 ms (Top 100.0%) | Memory 6.0 MB (Top 71.53%)
1 parent 87b498f commit d630e93

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
class Solution {
22
public:
33
bool rotateString(string s, string goal) {
4-
int n=s.size();
5-
int m=goal.size();
6-
if(n!=m)
7-
{
4+
if(s.size()!=goal.size()){
85
return false;
96
}
10-
string p=s+s;
11-
if(p.find(goal)!=string::npos)
12-
{
7+
string temp=s+s;
8+
if(temp.find(goal)!=-1){
139
return true;
1410
}
15-
else
16-
{
17-
return false;
18-
}
11+
return false;
1912
}
20-
};
13+
};

0 commit comments

Comments
 (0)