Justworks interview question

check if the input bucket array could make a given string.