Skip to content

Instantly share code, notes, and snippets.

View aaani's full-sized avatar

Ani Mishra aaani

View GitHub Profile
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
class SetOfStacks{
vector<stack<int>> stacks;
int threshold;
#include <iostream>
#include <vector>
using namespace std;
int Max(int a, int b){
return a>b?a:b;
}
int Min(int a, int b){
return a<b?a:b;
pair<pair<char,char>,int> maxLenSubstring2Chars(string s){
pair<char,int> lastChar;
lastChar.first=s[0];
lastChar.second=1;
pair<pair<char,char>,int> longestPairYet;
longestPairYet.second=-1;
pair<pair<char,char>,int> currentPair;
currentPair.first.first=s[0];
@aaani
aaani / get_xhr.js
Created August 16, 2014 06:52
Pure javascript module to send an ajax get request. It works well on IE8+ and other modern browsers.
var GetXHR = (function() {
var module = {};
module.sendRequest = function(url, callback) {
var req;
if (window.XDomainRequest) {
req = new XDomainRequest();
if (!req) return;
req.onload = function(){
body {
background-color: red;
}
body {
background-color: green;
}