Search
⌘K

Leetcode 2086. Minimum Number of Food Buckets to Feed the Hamsters

Place the minimum number of buckets on '.' positions in a 1D string so that every 'H' has a bucket at index i-1 or i+1, or return -1 if some hamster has no adjacent empty spot. This is a linear greedy/covering problem on a path (detecting impossible configurations like an H with both neighbors being H or out of bounds).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.