Company: Flexport_26nov
Difficulty: medium
Largest Subsequences Largest Subsequences Problem Description Given a string s of length n made up of lowercase English letters. For each length i (where 1 ≤ i ≤ n), find the subsequence of length i that is lexicographically largest. A subsequence is formed by removing zero or more characters from the original string without changing the order of the remaining characters. Return an array of strings, where the element at index i-1 is the lexicographically largest subsequence of length i . Examples Example 1: Input: s = "hrw" Output: ["w", "rw", "hrw"] Explanation: Length 1: The lexicographically largest subsequence is "w". Length 2: The lexicographically largest subsequence is "rw". Length 3: The lexicographically largest subsequence is "hrw". Example 2: Input: s = "dbca" Output: ["d", "dc", "dca", "dbca"] Explanation: Length 1: "d" Length 2: "dc" Length 3: "dca" Length 4: "dbca" Example 3: Input: s = "abcd" Output: ["d", "cd", "bcd", "abcd"] Explanation: Length 1: "d" Length 2: "