The OP's implementation wastes cycles in the n == 0 case because the statement `if (count == n)` is unnecessary.
The OP's implementation wastes cycles in the n == 0 case because the statement `if (count == n)` is unnecessary.