MCPcopy 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

2using namespace std;
3
4bool 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
11int main()
12{

Callers 1

mainFunction · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected