Skip to content

Instantly share code, notes, and snippets.

View tolinwei's full-sized avatar

Wei Lin tolinwei

  • Facebook
  • Cambridge, MA
View GitHub Profile
#include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int v) : value(v) {}
};
#include <iostream>
using namespace std;
class Node
{
public:
char value;
Node *next;
Node(char v) : value(v) {}
};
#include <iostream>
#include <unordered_set>
using namespace std;
class Node
{
public:
char value;
Node *next;
Node(char v) : value(v) {}
};
#include <iostream>
//#include <string>
using namespace std;
class Node
{
public:
char value;
Node *next;
Node(int v) : value(v) {}
};
#include <iostream>
#include <unordered_set>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int v) : value(v) {}
};
#include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int v) : value(v) {}
};
#include <iostream>
#include <string>
#include <bitset>
using namespace std;
bitset<1> is_unique(string s)
{
bitset<1> ret;
bitset<256> record;
record.reset();
#include <iostream>
#include <string>
using namespace std;
void replace_per(string &s)
{
int space_num = 0;
for (auto it = s.begin(); it != s.end(); it++) {
if (*it == ' ') {
space_num++;
#include <iostream>
#include <string>
using namespace std;
string str_compresion(string &s)
{
string ret;
int size = s.size();
int char_num = 1;
char tmp = s.front();
#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
using namespace std;
int main(int argc, char *argv[]) {
//vector of string test
vector<string> vs;