Problem · String

Reverse and Append

Learn this problem
MediumUberFULLTIMEOA
See Uber hiring insights

Problem statement

Given a string, you can reverse part of it from any index towards left or right.

Output all possible list of strings.

Function

reverseAndAppend(s: String) → List<String>

Complete the function reverseAndAppend in the editor.

reverseAndAppend has the following parameter:

  1. String s: the original string

Returns

List: the list of all possible strings after reversing and appending

Halooo~~ Uber assessment comes with 4 coding questions. The other 3 are in here 🍉 -

Generate Arrays (Click to view surprise :) 🍊

Examples

More Uber problems

drafts saved locally
public List<String> reverseAndAppend(String s) {
  // write your code here
}
s"dbaacca"
expected["bdaacca", "abdacca", "dbaacac"]
checking account