I was really confused about how Chef and Equality is supposed to work, and looking at the comments just made me more confused. Someone asked if the program was supposed to count number of piles that need to be changed, or number of operations (something I was wondering as well) and the response was “Question clearly mentions that you need to find the minimum number of operations needed.”

Okay, but what’s one operation? At first I thought it meant one coin could be taken or given at a time, but later there was a clarification posted that said “In the sample case… suppose you want to make all piles to size 1, then remove 1 coin from pile 2 and put it in the box, remove 2 coins from pile 3 and put it in the box and remove 3 coins from the 4th pile and put it in the box… So in 3 operations all piles become equal having 1 coin each…” which I guess means that any operation can add or remove as many coins as needed. Wouldn’t that make the amount of operations needed and the number of piles needed to be changed the same thing? Am I misunderstanding something here?