Problem · String
Reverse and Append
Learn this problemProblem 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:
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 🍉 -
Examples
Example 1
s = "dbaacca"return = ["bdaacca", "abdacca", "dbaacac"]From index 1, reverse db-> append with rest of original -> bdaacca
From index 2, reverse dba -> append with rest of original -> abdacca
From index 5, reverse ca towards right -> append with rest of original -> dbaacac
Output all possible list of strings
PPS: I have a strong gut feeling that these might not be the correct versions of the output. The current outputs are just placeholders. I'll come back to update them once I find a more reliable source in the future. As for how far in the future… that's a myth no one knows. I'll see you next time!
More Uber problems
- Last Truck to Leave the LaneOA · Seen Jul 2026
- Chain of CommandOA · Seen Jul 2026
- Jump Game with Prime-3 StepsOA · Seen Jun 2026
- Total Palindrome Substring CostOA · Seen Jun 2026
- Earliest Time All Users Are ConnectedPHONE SCREEN · Seen May 2026
- Tournament Rounds by RankPHONE SCREEN · Seen May 2026
- Farthest Seat AssignmentONSITE INTERVIEW · Seen May 2026
- Convex Function MinimizationPHONE SCREEN · Seen May 2026