Skip to content

cheerayhuang/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode

solutions of leetcode.

same tree

Get the pre-order and in-order of these two trees, and check whether they are equal.

symmetric tree

Construct a new Tree with rotating the original tree with Y-axis, and then check whether they are same.

maximum depth of binary tree

simple BFS the tree, and record the depth.

atoi

use APIs

add binary

use a string to store the numbers.

balance binary tree

check left and right sub-tree with recursion.

binary tree level order traversal

BFS the tree

climbing stairs

recursion

compare version

APIs, to_string, stoi API in C++11

count and say

APIs, find_first_not_of

intersection of two linked list

simple iterate the two lists.

length of last word

APIs, find_last_not_of, find_last_of

longest common prefix

sort strs, and choose the smallest one to check longest common prefix.

merge sorted array/list

a step of merge sort

min stack

use another stack to store the minimum number

n-queen

classical problem

palindrome number

use string::reserve, iterator, etc..

pascal trigle

classical problem

path sum

BFS the tree

plus one

high-precision addition

remove duplicates from sorted array

algorithm unique()

remove element

iterate the array, and move the numbers to beginning, which is not equal to N.

remove nth node from end

two potins, keep them N distance, and then iterate the array.

reserve the integer

string::reserve

roman to integer

simple simulate the roman number rule.

sort list

heap sort, any sort algorithm...

spiral-matrix

use director vars to simulate.

sqrt

dichotomy

strStr

KMB algorithm

valid palindrome

APIs

valid parentheses

stack handle parentheses

word break

dynamic programming

zigzag-conversion

simple simulate

About

solutions of leetcode.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages