0

Pls help me to get the output

Given an string targets separated with hyphen '-' with an integer n separated by '#'. In each iteration, you will read a number from string. Build the string number values using the following operations: Push: Read a new element from the beginning of the string number values, and push it in the array. Pop: delete the last element from the string. If the target value in the string is already built, stop reading more elements. Return the operations to build the target array. You are guaranteed that the answer is unique. Input Format The input format is string Constraints 1 <= target.length <= 100 1 <= target[i] <= n 1 <= n <= 100 target is strictly increasing. Output Format The output format is array Sample Input 0 1-3#3 Sample Output 0 ["Push","Push","Pop","Push"] Explanation 0 Read number 1 and automatically push in the array -> [1] Read number 2 and automatically push in the array then Pop it -> [1] Read number 3 and automatically push in the array -> [1,3] Sample Input 1 1-2-3#3 Sample Output

10th Nov 2022, 4:18 PM
Rajeshwari. S
Rajeshwari. S - avatar
2 Antworten
+ 9
Rajeshwari. S , > have you done any try that you can link here? > without having seen your code it is difficult to find the issues that you have.
10th Nov 2022, 4:53 PM
Lothar
Lothar - avatar
0
Hi
12th Nov 2022, 1:11 PM
MD Atikur
MD Atikur - avatar