A friend gave me this riddle, stating that it would be easy for children but hard for grown-ups.
Any combination of four digits has an determined value. Here are some examples (note, the position of the example is of no relevance):
0000 = 4
0001 = 3
1111 = 0
1234 = 0
2266 = 2
4068 = 4
6666 = 4
6088 = 6
7654 = 1
8888 = 8
8901 = 4
9966 = 4
9998 = 5
You may ask for any other four-digit number and there is a determined value for it as well. What is the value-function based upon?