Nextdoor interview question

array in string and re-arrange dfs problem