Skip to content

Conversation

@Shamoyeeta
Copy link
Contributor

Pull Request Template

Description

The Leetcode file system keeps a log each time some user performs a change folder operation.

The operations are described below:

"../" : Move to the parent folder of the current folder. (If you are already in the main folder, remain in the same folder).
"./" : Remain in the same folder.
"x/" : Move to the child folder named x (This folder is guaranteed to always exist).
You are given a list of strings logs where logs[i] is the operation performed by the user at the ith step.

The file system starts in the main folder, then the operations in logs are performed.

Return the minimum number of operations needed to go back to the main folder after the change folder operations.

Code Explanation:
All elements of the vector are traversed and appropriate push and pop operations are performed according to the given condition. After all loop is over, the final number of steps required to go back to the main folder is equal to the size if rhe existing stack, and thus the program returns this size.

Issue #90

Put check marks:

Have you made changes in README file ?

  • Added problem & solution under correct topic.
  • Specified Space & Time complexity.
  • Specified difficulty level, tag & Note(if any).

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • ["d1/","d2/","./","d3/","../","d31/"]
  • ["d1/","d2/","../","d21/","./"]

Make sure all below guidelines are followed else PR will get Reject:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code so that it is easy to understand
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
@GouravRusiya30 GouravRusiya30 merged commit dccfe9a into codedecks-in:master Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants