On Tuesday, 3 November 2015 at 15:29:31 UTC, Namal wrote:
writefln("Count is: %s", arr .filter!(a => a==true) .sum);// Note: std.algorithm.sum is the same as // std.algorithm.reduce!((a,b)=a+b);
Shouldn't you be using walkLength instead of sum, since you are counting the left over values?
import std.range : walkLength;
writefln("Count is: %s", arr
.filter!(a => a==false)
.walkLength);
