This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Node | |
{ | |
public: | |
int value; | |
Node *next; | |
Node(int v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Node | |
{ | |
public: | |
char value; | |
Node *next; | |
Node(char v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <unordered_set> | |
using namespace std; | |
class Node | |
{ | |
public: | |
char value; | |
Node *next; | |
Node(char v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
//#include <string> | |
using namespace std; | |
class Node | |
{ | |
public: | |
char value; | |
Node *next; | |
Node(int v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <unordered_set> | |
using namespace std; | |
class Node | |
{ | |
public: | |
int value; | |
Node *next; | |
Node(int v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Node | |
{ | |
public: | |
int value; | |
Node *next; | |
Node(int v) : value(v) {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <bitset> | |
using namespace std; | |
bitset<1> is_unique(string s) | |
{ | |
bitset<1> ret; | |
bitset<256> record; | |
record.reset(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |