I tried to solve problems like : 1. SPOJ POSTERIN 2. SPOJ HISTOGRA 3. Codeforces C2.Skyscrapers But i could not even understand the logic behind the stack based O(n) solution of above problems. Can anybody help.
Common stack problems
I tried to solve problems like : 1. SPOJ POSTERIN 2. SPOJ HISTOGRA 3. Codeforces C2.Skyscrapers But i could not even understand the logic behind the stack based O(n) solution of above problems. Can anybody help.