Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Code Addition Request]: Stack Permutation #966

Closed
3 tasks done
shuvojitss opened this issue Oct 31, 2024 · 2 comments · Fixed by #987
Closed
3 tasks done

[Code Addition Request]: Stack Permutation #966

shuvojitss opened this issue Oct 31, 2024 · 2 comments · Fixed by #987
Assignees
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.

Comments

@shuvojitss
Copy link
Contributor

Have you completed your first issue?

  • I have completed my first issue

Guidelines

  • I have read the guidelines
  • I have the link to my latest merged PR

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

Copy link

🙌 Thank you for bringing this issue to our attention! We appreciate your input and will investigate it as soon as possible.

Feel free to join our community on Discord to discuss more!

@UTSAVS26 UTSAVS26 added Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. Status: Assigned💻 Indicates an issue has been assigned to a contributor. level1 hacktoberfest labels Oct 31, 2024
Copy link

github-actions bot commented Nov 1, 2024

✅ This issue has been closed. Thank you for your contribution! If you have any further questions or issues, feel free to join our community on Discord to discuss more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants