Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ areRotated
Function
areRotated
CPP/String/areRotation.cpp:4–9 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
2
using namespace std;
3
4
bool areRotated(string s1, string s2)
5
{
6
if (s1.length() != s2.length())
7
return false;
8
return (s1 + s1).find(s2) != string::npos;
9
}
10
11
int main()
12
{
Callers
1
main
Function · 0.85
Calls
2
length
Method · 0.80
find
Method · 0.45
Tested by
no test coverage detected