Skip to content

Instantly share code, notes, and snippets.

View SAgarwal-24's full-sized avatar

Shubham Agarwal SAgarwal-24

  • Vellore Institute of Technology
  • Chennai
View GitHub Profile
class Solution {
public:
string removeKdigits(string num, int k) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n = num.size();
stack<char> mystack;
//Store the final string in stack
for(char c: num)
class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int high = nums.size()-1;
int low = 0;
int mid;
class Solution {
public:
bool canJump(vector<int>& nums) {
int n = nums.size();
int reachable = 0;
for(int i=0;i<n;++i)
{
if(reachable < i)