Skip to content

Instantly share code, notes, and snippets.

/*
http://www.careercup.com/question?id=12986664
Push all the zero's of a given array to the end of the array. In place only. Ex 1,2,0,4,0,0,8 becomes 1,2,4,8,0,0,0
*/
#include <vector>
#include <iostream>
using namespace std;
void putZeroToEnd(vector<int> &vec) {
// i for next non-zero num index
// j for normal move forward index
/*
http://www.careercup.com/question?id=19300678
If a=1, b=2, c=3,....z=26. Given a string, find all possible codes that string can generate. Give a count as well as print the strings.
For example:
Input: "1123". You need to general all valid alphabet codes from this string.
Output List
aabc //a = 1, a = 1, b = 2, c = 3
kbc // since k is 11, b = 2, c= 3
@sturgle
sturgle / SquareDetector
Last active December 29, 2015 01:59
Square Detector
#include <vector>
#include <iostream>
#include <string>
using namespace std;
int main()
{
int kase;
cin>> kase;
for (int k = 1; k <= kase; k++)