Last active
April 22, 2021 22:03
-
-
Save naxmefy/e24cc7b54d10a5e2b9b5db7eb589e9de to your computer and use it in GitHub Desktop.
found avg char in a word
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r=readline().split`` | |
console.log(String.fromCharCode(Math.round(r.reduce((p,c)=>{ | |
console.error(c, c.charCodeAt()) | |
return p+c.charCodeAt() | |
},0)/r.length))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import math | |
s = input() | |
print(chr(round(sum(map(ord,s))/len(s)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts (1.0*gets.sum/$_.size).round.chr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment