class Solution {
public int solution(String A, String B) {
int answer = 0;
// "hello" "ohell" 1
// 정방향
String tempA = A;
for (int i = 0; i < A.length(); i++) {
if(tempA.equals(B)){
return answer;
}
// substring(설정 X,문자열.length)를 하면 끝 글자 한글자만 반환한다.
// 'o'
String tempASubString = tempA.substring(tempA.length() - 1);
// index 0 부터 , 끝 한 글자 빼고 반환, tempA에 담아주어서 for문 반복
// o + hell
tempA = tempASubString + tempA.substring(0, tempA.length() - 1);
answer ++;
}
return -1;
}
}