I know its simple problem, but i want to know if it can be solved some other way around.Here goes the problem.
Input: 234 , 54678 , 34987
Problem is to calculate how many of the numbers(by number i mean the comma separated number not single digit) has an average greater than 2.Sure we can sum up digit's of each comma separated numbers and then calculate the average by dividing it by its count. But i want to know if there is some other way of doing it which skips summing up the digits and dividing it by its count.
There are several tricks which may help in some cases: for example for $54678$ where each digit is greater than $2$ and so their average is.
But there will be other cases such as $1112070133$ and $1112090133$ where I expect summing the digits and dividng by the number of digits is going to be one of the easiest options.
If you really hate division or counting numbers of digits, then you can subtract $2$ from each digit before adding up, so the calculation for $1112070133$ becomes $-1-1-1+0-2+5-2-1+1+1 = -1$ which being negative shows that the digit average is below $2$.