-
Input:
count((x)->x,[2,12,45,3,7,78])
Output:
because: 2+12+45+3+7+78=147.
- Input:
count((x)->x<12,[2,12,45,3,7,78])
Output:
- Input:
count((x)->x==12,[2,12,45,3,7,78])
Output:
- Input:
count((x)->x>12,[2,12,45,3,7,78])
Output:
- Input:
count(x->x^2,[3,5,1])
Output:
Indeed 32+52+11=35.
- Input:
count(id,[3,5,1])
Output:
Indeed, id is the identity functions and 3+5+1=9.
- Input:
count(1,[3,5,1])
Output:
Indeed, 1 is the constant function equal to 1 and 1+1+1=3.