We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
One more thing that i see was not mentioned, they talk about stacks however the problem statement is a bit confusing in this regard.
he problem describes the given strings as "stacks", which implies a LIFO (last-in, first-out) data structure, while the processing order is FIFO (first-in, first-out).
This seems contradictory.
To clarify, we can think of the given strings as a "stack of cards" where we can only pick the top card.
However, the order in which we pick the cards can follow a FIFO approach. This is similar to how we can access the elements of a queue in a LIFO manner by using a stack data structure.
very bad problem description.
So, in essence, the problem is asking us to pick elements from the given strings in a specific order (FIFO), but we can only access the top element of each string, which is why the problem describes them as "stacks".
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Morgan and a String
You are viewing a single comment's thread. Return to all comments →
One more thing that i see was not mentioned, they talk about stacks however the problem statement is a bit confusing in this regard. he problem describes the given strings as "stacks", which implies a LIFO (last-in, first-out) data structure, while the processing order is FIFO (first-in, first-out). This seems contradictory. To clarify, we can think of the given strings as a "stack of cards" where we can only pick the top card. However, the order in which we pick the cards can follow a FIFO approach. This is similar to how we can access the elements of a queue in a LIFO manner by using a stack data structure.
very bad problem description.
So, in essence, the problem is asking us to pick elements from the given strings in a specific order (FIFO), but we can only access the top element of each string, which is why the problem describes them as "stacks".