You are the proud owner of a window washing company. Your workers tirelessly clean the outside of tall buildings. Of course, not all of your workers are equal. Some are faster than others. So your job is to place them at the best locations so that the job gets done the fastest. All the workers work in the same pattern. They start at the top of the first column of windows they are to wash. Using lifts, they wash the highest window, then the second highest, and so forth until all the windows in a column are washed. When they reach the lowest window, they use the lift controls to move to the column to the right. In this column, they work their way up the building until they reach the top. Using this zig-zag pattern, they wash all the windows they can until they get either to a column of windows that is being washed, or has been washed by another worker, or to the edge of the building. Because the lifts are on the same railing, they cannot cross over each other, or be in the same column at the same time. Not all of your workers need to be used on a job, and not all of them need to be working the entire time.
You will be given three arguments. width is the number of window columns the side of a building has, height is the number of rows of windows the side of a building has, and washTimes is a int[] which represents the time it takes each worker to wash a single window, in seconds. Each element represents a different worker's wash time.
Given this information, return the least amount of time in which your crew can wash that side of the buliding.
|