Skip to content

Instantly share code, notes, and snippets.

View Firoz-Thakur's full-sized avatar
❤️
Code Game

Firoz Kumar Firoz-Thakur

❤️
Code Game
  • SWE at Innovaccer || Ex NAVI Technologies
  • Banglore
  • 00:49 (UTC -12:00)
View GitHub Profile
// C++ linear time solution for stock span problem
#include <iostream>
#include <stack>
using namespace std;
// A stack based efficient method to calculate
// stock span values
void calculateSpan(int price[], int n, int S[])
{
// Create a stack and push index of first