[Code Addition Request]: Stack Permutation #966
Labels
Contributor
Denotes issues or PRs submitted by contributors to acknowledge their participation.
gssoc-ext
hacktoberfest
level1
Status: Assigned💻
Indicates an issue has been assigned to a contributor.
Have you completed your first issue?
Guidelines
Latest Merged PR Link
#960
Project Description
Problem Statement
Given two arrays, both of unique elements. One represents the input queue and the other represents the output queue. Our task is to check if the given output is possible through stack permutation.
Sample Input and Output:
Input:
arr1[] = [ 1, 2, 3 ] , arr2[] = [ 2, 1, 3 ]
Output:
YES
Explanation:
push 1 from input to stack
push 2 from input to stack
pop 2 from stack to output
pop 1 from stack to output
push 3 from input to stack
pop 3 from stack to output
Input
arr1[] = [ 1, 2, 3 ] , arr2[] = [ 3, 1, 2 ]
Output
Not Possible
Full Name
Shuvojit Samanta
Participant Role
GSSOC
The text was updated successfully, but these errors were encountered: