Company: Flexport_26nov
Difficulty: medium
Largest Subsequences Problem Description Given a string s of length n made up of lowercase English letters. For each length i (between 1 and the length of the string), find the subsequence of length i that appears last when all subsequences of that length are arranged in alphabetical order. A subsequence is formed by removing zero or more characters from the original string without changing the order of the remaining characters. Complete the function getLargestSubsequences in the editor. It has the following parameter: string s : the given string The function must return an array/list of strings, where each element at index i is the alphabetically largest subsequence for length i+1 . Examples Example 1 Input: s = "hrw" Output: ["w", "rw", "hrw"] Explanation: Length 1: The alphabetically largest subsequence is "w". Length 2: The alphabetically largest subsequence is "rw". Length 3: The alphabetically largest subsequence is "hrw". Example 2 (Sample Case 0) Input: s = "dbca" Output: d dc