Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 172 characters in body
Source Link
the default.
  • 8.5k
  • 1
  • 37
  • 63

C# (Visual C# Interactive Compiler), (削除) 17 (削除ここまで) 14 bytes

Turns out Ranges finally started to actually exist and work! Thanks to an anonymous user for pointing this out (by proposing an edit, but anonymous users cannot comment...)

s=>160%s[^1]%7

Try it online!

C# (Visual C# Interactive Compiler), (削除) 17 (削除ここまで) 14 bytes

s=>160%s[^1]%7

Try it online!

C# (Visual C# Interactive Compiler), (削除) 17 (削除ここまで) 14 bytes

Turns out Ranges finally started to actually exist and work! Thanks to an anonymous user for pointing this out (by proposing an edit, but anonymous users cannot comment...)

s=>160%s[^1]%7

Try it online!

Use Ranges (https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/ranges) to make it even shorter
Source Link

C# (Visual C# Interactive Compiler), 17(削除) 17 (削除ここまで) 14 bytes

s=>160%s.Last()%7s=>160%s[^1]%7

Try it online! Try it online!

C# (Visual C# Interactive Compiler), (削除) 17 (削除ここまで) 14 bytes

s=>160%s[^1]%7

Try it online!

I have now read the answers and noticed that people have found this before me
Source Link
the default.
  • 8.5k
  • 1
  • 37
  • 63

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

I guess C# beats Perl, Ruby and Python here...

s=>ss=>160%s.Last()*9%11%4%7

Try it online! Try it online!

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

I guess C# beats Perl, Ruby and Python here...

s=>s.Last()*9%11%4

Try it online!

Source Link
the default.
  • 8.5k
  • 1
  • 37
  • 63
Loading

AltStyle によって変換されたページ (->オリジナル) /