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 -1 at Navi || Ex Securonix
  • Banglore
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