New answers tagged

6

Try it online! Note: Due to a certain username pointed out by Wezl in the comments, this answer is not valid for the current challenge. Why this works:


6

.NET, 39 37 bytes ^(?=((?>^((?<-1>x)+|x)|\1\2\2))*$){2} Try it online! Not only does this outgolf primo's amazing answer, but it runs at very close to exactly the same speed under .NET's regex engine. This solution uses the .NET-specific feature of balanced groups, where every time a group is captured, it's pushed onto the stack for that particular ...


Top 50 recent answers are included