Amazon Online Assessment (OA) - Partition String
Given a string S
of lowercase letters.
Partition S
into as many parts as possible so that one letter only appears in one part.
Input
The input consists of one argument:
S
: a string of lowercase letters
Output
Return the partitions as a list.
Examples
Example 1:
Input:
S = "bbeadcxede"
Output: ["bb", "eadcxede"]
Example 2:
Input:
S = "baddacx"