Skip to content

Instantly share code, notes, and snippets.

View sonsongithub's full-sized avatar

Yuichi Yoshida sonsongithub

View GitHub Profile
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
public:
int kthGrammar(int N, int K) {
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
class Solution {
public:
unordered_map<int, double> mp;
double myPow(double x, int n) {
int64_t m = (int64_t)n;
if (n < 0) {
x = 1 / x;
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
class Solution {
public:
unordered_map<int, int> mp;
@sonsongithub
sonsongithub / FibonacciNumber.cpp
Created March 25, 2019 09:11
Fibonacci Number
#include <vector>
#include <iostream>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
@sonsongithub
sonsongithub / main.cpp
Created March 22, 2019 04:14
leetcode
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> array{};
@sonsongithub
sonsongithub / main.cpp
Last active March 21, 2019 13:52
leetcode
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> result{};
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> result{};
@sonsongithub
sonsongithub / llvm_batch_build.sh
Last active February 17, 2019 23:20
Batch build script for LLVM.
#!/bin/bash
git_branch=`git branch -r`
touch ../result.txt
date > ../result.txt
branches=()
for line in ${git_branch}