Google Interview Question for Java Developers
- 0of 0 votes
Giving start string and end string, determine if start string can finally reach to the same as end string with below rules.- ajay.raj January 18, 2018 in United States
"R L _ _ L R L"
"_": the space is empty
"L": this can only swap with the empty letter _ on its left side
"R": this can only swap with the empty letter _ on its right side
So, "R L _ _ L R L" can change to "R L _ L _ R L" , and can continue change to (if you want) "R L L _ _ R L". from: 1point3acres.com/bbs
The question is given these rules and the start string and end string, could we change the start string to end string (unlimited # moves as long as it is valid).
"R _ _ L R _ R _L"
can be changed to
"_ R L _ _ R R L _"
| Report Duplicate | Flag | PURGE
Google Java Developer
Open Chat in New Window