judge the final ball color in bucket of black and white problem