Рет қаралды 50,130
This video explains the stock span problem in the simplest way possible. First i have explained the intuitive approach of solving using bruteforce in O(N2) time and then i have shown the intuition behind efficient approach and solved it using stack in just O(N) time. The CODE LINK for the efficient approach is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
CODE LINK: gist.github.co...