Solution for remove_by_value