filmov
tv
Reorganize String - Leetcode 767

Показать описание
Interview question asked by Amazon, Facebook, Google and Goldman Sachs
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.
If possible, output any possible result. If not possible, return the empty string.
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.
If possible, output any possible result. If not possible, return the empty string.