Given an array of integers and a value, fill result with all positions of the value in the array. Return the size of result.