Skip to main content
added 32 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12

C# (Visual C# Interactive Compiler), 40 bytes

s=>s.Where((c,i)=>c!=$"{s}"[i|1]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

-3 bytes inspired by @Oliver

C# (Visual C# Interactive Compiler), 40 bytes

s=>s.Where((c,i)=>c!=$"{s}"[i|1]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

C# (Visual C# Interactive Compiler), 40 bytes

s=>s.Where((c,i)=>c!=$"{s}"[i|1]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

-3 bytes inspired by @Oliver

added 23 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12

C# (Visual C# Interactive Compiler), 4340 bytes

s=>(s+="")s=>s.Where((c,i)=>c!=s[i-i%2]=$"{s}"[i|1]).Any() 

Try it online!Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

C# (Visual C# Interactive Compiler), 43 bytes

s=>(s+="").Where((c,i)=>c!=s[i-i%2]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

C# (Visual C# Interactive Compiler), 40 bytes

s=>s.Where((c,i)=>c!=$"{s}"[i|1]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

deleted 15 characters in body; added 22 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12

C# (Visual C# Interactive Compiler), 4443 bytes

s=>!(s+="").Where((c,i)=>c!=s[i-i%2]).Any() 

Try it online!Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to prevent an index out of range exception in the caselast character of an odd-length length string.

Outputs are reversed.

C# (Visual C# Interactive Compiler), 44 bytes

s=>!(s+="").Where((c,i)=>c!=s[i-i%2]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input to prevent an index out of range exception in the case of an odd-length string.

C# (Visual C# Interactive Compiler), 43 bytes

s=>(s+="").Where((c,i)=>c!=s[i-i%2]).Any() 

Try it online!

Each character is tested against it's neighbor for inequality. If any inequalities exist, the result is false.

Since input is limited to printable ASCII characters, a control character is appended to input which is compared to the last character of an odd length string.

Outputs are reversed.

deleted 1 character in body
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12
Loading
added 278 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12
Loading
Source Link
dana
  • 2.7k
  • 1
  • 17
  • 12
Loading