modify solution for singleNumberII