you give 0indexed string hamster hamstersi eitherH indicate hamster index indicate index emptyyou add number food bucket index order feed hamster a hamster fed food bucket leave right more formally hamster index fed place food bucket index 1 andor index 1return minimum number food bucket place index feed hamster 1 impossible feed example 1input hamster hhoutput 2explanation we place food bucket index 1 2it show place food bucket hamster fedexample 2input hamster hhoutput 1explanation we place food bucket index 2example 3Input hamster HHHOutput 1explanation if place food bucket index show hamster index 2 able eat Constraints1 hamsterslength 105hamstersi eitherH