Solution
An optimal way to change requires seven coins. Let’s consider an arbitrary subset of an optimal solution, e.g., four coins within a rectangle shown below sum up to .
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.