Domanda di colloquio di eBay

It is a DP problem for LC, probably LC medium difficulty.