Newbie post - stuck on this question I got during an interview.
Suppose you have an array of houses "-H-H-H", each house needs to be close to a water tank on either its left or right side. How many water tanks do you need? Water Tanks can only go where there is a dash.
Ex. "-H-H-H" -> solution: 2 tanks needed, one option is '-HTHTH', or 'TH-HTH'
Can anyone point me to a similar leetcode problem? Not sure how to even start. Many Thanks.