Nearest Smaller Element (NSE)
Problem
Given an array, find the nearest smaller element G[i] for every element A[i] in the array such that the element has an index smaller than i. (link)
More formally,
G[i] for an element A[i] = an element A[j] such that
j is maximum poss...
chetan77.hashnode.dev3 min read