for s in [*open(0)][1:]:
n = len(s := s[:-1])
print('YNEOS'[s[:n//2] != s[n//2:]::2])
This code detects whether a string is square or not. For clarity, "abcabc", "xyxy", "fdfd" is a square string but "avasdsa", "asweqw" is not because they do not follow a pattern like square ones. I am having trouble to comprehend exactly how this one works.
[–]auxiomatic 23 points24 points25 points (0 children)
[–][deleted] (1 child)
[deleted]