La soluzione che proponi è "greedy", ovvero non garantisce l'ottimo globale.