#05AB1E (legacy), 56 5 2 bytes
2ô¶ζËιË
Only works in the legacy, because zip/transpose works on strings, whereas with the new versionInput as a list of 05AB1E and explicit S (split to characters) and J (join to string) are required.
Try it online or-3 bytes by porting verify a few more test cases.
#05AB1E@Saggy's Japt answer, 9 6 bytesso make sure to upvote him!
γ€g2ÖP
Try it onlineTry it online or verify a few more test casesverify a few more test cases.
Explanation:
2ô ι # SplitUninterleave the (implicit) input into parts-list of size 2characters # i.e. "tttteesstt!!!" → ["tt"["t","tt""t","ee""t","ss""t","tt""e","e","s","s","t","t","!!","!"] ¶ζ # Zip/transpose; swapping rows/columns, with a newline character as filler # → ["ttest!!","ttest"!\n"] Ë # Check if both strings are equal # → 0 (falsey) # (after which the result is output implicitly) γ # Split the (implicit) input into parts where equal characters are grouped together"] # i.e. "tttteesstt!!!" → ["tttt"[["t","ee""t","ss""e","tt""s","t","!!","!"] €g # Get the length of each part # → [4,2,2,2["t",3] 2Ö # Check for each if it's divisible by 2 # → [1"t",1"e",1"s",1"t",0]"!"]] PË # And take the productCheck toif checkboth ifinner alllists are truthyequal # → 0 (falsey) # (after which the result is output implicitly)