1class Solution {23public boolean repeatedSubstringPattern(String s) {4String temp = "";5for (int i = 0; i < s.length() / 2; i++) {6temp += s.charAt(i);78if (s.length() % temp.length() == 0) {9int times_repeat = s.length() / temp.length();10StringBuilder str = new StringBuilder();11for (int j = 0; j < times_repeat; j++) {12str.append(temp);13}14if (str.toString().equals(s)) return true;15}16}17return false;18}19}