Implement the isRotationOfString method that checks whether one string can be formed by rotating the other string.

The input contains two strings first and second. Your task is to check whether second is a rotation of first.

A rotation keeps the same characters in the same circular order, but starts from a different position. For example, cdab is a rotation of abcd.

Example 1
Input:
first (string) = abcd
second (string) = cdab
Return:
(boolean) true
Example 2
Input:
first (string) = abcd
second (string) = acbd
Return:
(boolean) false
Example 3
Input:
first (string) = water
second (string) = terwa
Return:
(boolean) true

Two strings can be rotations only when their lengths are equal.

If second is a rotation of first, it will always appear inside first + first. For example, abcdabcd contains cdab.

Pseudocode:

function isRotationOfString(first, second):
    if length(first) != length(second):
        return false
    doubled = first + first
    if second exists inside doubled:
        return true
    return false
Run your code to see the result.