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 Revisions

3 of 3
added 520 characters in body
Olivier Grégoire
  • 14.5k
  • 3
  • 33
  • 56

Java (JDK), 4 bytes

A->9

Try it online!

Outputs the number 9 which as a character is the average character of the code.

Defined as a int f(Void v). Note that Void is an accepted argument type for "no input" challenges.

If an int isn't an acceptable output for this challenge, the following is most definitely valid, for an extra byte.

A->56

Try it online!

Outputs 8 which is the average character.

Defined as a char f(Void v). I was surprised that no casting to char was required, but it beats v->';' by one byte.

Olivier Grégoire
  • 14.5k
  • 3
  • 33
  • 56

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