Tasty Meal

To solve the problem we can easily observe that swapping the first c with the last p minimizes the tastiness. The answer is \(0\) when either: there are not p there are not c the last p is before the first c For example: 1 pppccc Instead, if neither of the conditions above occur, we swap the first occurrence of c with the last occurrence of p and we proceed with computing the tastiness. [Read More]