update candy & single_number more simple