public IDictionary <int, int> GetNextGreaterElement()
        {
            LBStack <int> st = new LBStack <int>();

            foreach (int i in items)
            {
                st.Push(i);
            }
            while (!st.IsEmpty())
            {
                int item = st.Peek();
                if (st.top == 0 || st.top == items.Length - 1)
                {
                    st.Pop();
                    data.Add(item, -1);
                }
                else
                {
                    st.Pop();
                    data.Add(item, max);
                }
                max = item < max ? max : item;
            }

            return(data);
        }
        private void calculateArea(int[] items, LBStack <int> st, int index)
        {
            int pop_index   = st.Pop();
            int lower_bound = st.IsEmpty() ? -1 : st.Peek();
            int area        = items[pop_index] * ((index - 1) - lower_bound);

            UpdateArea(area);
        }