Ad
  • Custom User Avatar

    I don't see this as the biggest flaw here - the conversion to a char and then to an int and using sum is way to complicated. Just use sumBy directly on the String (no need to get the CharArray at all!) and define the summing value to be Character.getNumericValueOf(c). Done.

    This is not so "clever" as some people pointed out. :-) And it's not a best practice to do it with more steps than necessary.