Company: Sharechat_15oct
Difficulty: medium
Subsequence Sort Problem Description You have a binary string binary consisting of characters '0' and '1'. You can perform the following operation any number of times: Choose any subsequence of the string, sort it, and replace the original subsequence with the sorted sequence. You also have an array of strings arr of length n , where each string has the same length as binary and consists of characters '0', '1', and '?'. Each '?' character can be replaced with either '0' or '1'. For each string in arr , determine if it is possible to rearrange binary using the described operation after replacing each '?' with either '0' or '1'. For each string, return "YES" if it is possible, and "NO" if it is not. Note: A subsequence is obtained by deleting some characters without changing the order of the remaining characters. Each computation is independent, with binary in its original state at the beginning of each test. Examples Example 1: Input: binary = "101011" arr = ["???111", "001101"] Output: