Skip to content

Instantly share code, notes, and snippets.

View zhangxiaomu01's full-sized avatar
🎯
Focusing

Jun Zhang zhangxiaomu01

🎯
Focusing
View GitHub Profile
class Solution {
private:
vector<string> strDic = {"", "", "abc", "def", "ghi","jkl", "mno","pqrs", "tuv", "wxyz"};
vector<string> finalVec;
public:
vector<string> letterCombinations(string digits) {
int len_d = digits.length();
for(int i = 0; i < len_d; i++){
int index = digits[i] - '0';
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
vector<string>res;
class Solution {
public:
void choose(string prix,int left,int right,int times,int num){
if(times==num){
string temp =prix+")";
res.push_back(temp);
return;
}
if(left<num/2){
class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> res;
if(n == 0)
res.push_back("");
else{
for(int left = 0; left < n; left++){
vector<string> tempL = generateParenthesis(left);
for(int i = 0; i< tempL.size(); i++){
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public: