leetcode
leetcode
The
optimum
C++
solutions
for
the
leetcode
这是我自己写的leetcode的题解,目前已经完成了70%左右,后续部分会很快更新
这里放上来的代码都能保证是最优解(复杂度最优)
当然有些题目因为测试数据等原因可能会和统计中最快的代码在时间上有常数的差距
希望对需要的人能有些帮助
leetcode-master.zip
leetcode-master
Search Insert Position
Search Insert Position.cpp
377B
Nim Game
Nim Game.cpp
497B
Single Number II
Single Number II.cpp
698B
First Missing Positive
First Missing Positive.cpp
631B
Linked List Cycle
Linked List Cycle.cpp
591B
Search for a Range
Search for a Range.cpp
751B
Intersection of Two Linked Lists
Intersection of Two Linked Lists.cpp
988B
Dungeon Game
Dungeon Game.cpp
1.1KB
Rotate List
Rotate List.cpp
916B
Reverse Linked List
Reverse Linked List.cpp
533B
Implement Stack using Queues
Implement Stack using Queues.cpp
1.2KB
Binary Tree Postorder Traversal
Binary Tree Postorder Traversal.cpp
1009B
Reverse Vowels of a String
Reverse Vowels of a String.cpp
682B
Add Two Numbers
Add Two Numbers.cpp
1KB
Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order Traversal.cpp
1KB
Reverse Integer
Reverse Integer.cpp
393B
Interleaving String
Interleaving String.cpp
1.1KB
Permutations II
Permutations II.cpp
989B
Divide Two Integers
Divide Two Integers.cpp
1.3KB
Plus One
Plus One.cpp
582B
Course Schedule
Course Schedule.cpp
2.1KB
Number of 1 Bits
Number of 1 Bits.cpp
279B
Reverse String
Reverse String.cpp
254B
Longest Valid Parentheses
Longest Valid Parentheses.cpp
682B
Kth Smallest Element in a BST
Kth Smallest Element in a BST.cpp
687B
Count Primes
Count Primes.cpp
819B
Move Zeroes
Move Zeroes.cpp
389B
Climbing Stairs
Climbing Stairs.cpp
334B
Set Matrix Zeroes
Set Matrix Zeroes.cpp
1.2KB
Single Number III
Single Number III.cpp
708B
Remove Duplicates from Sorted List
Remove Duplicates from Sorted List.cpp
532B
ZigZag Conversion
ZigZag Conversion.cpp
802B
Bulb Switcher
Bulb Switcher.cpp
513B
Palindrome Linked List
Palindrome Linked List.cpp
1.1KB
Combination Sum III
Combination Sum III.cpp
797B
Coin Change
Coin Change.cpp
895B
Excel Sheet Column Title
Excel Sheet Column Title.cpp
292B
N-Queens II
N-Queens II.cpp
978B
House Robber III
House Robber III.cpp
1.5KB
Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock II.cpp
954B
Guess Number Higher or Lower
Guess Number Higher or Lower.cpp
596B
Contains Duplicate
Contains Duplicate.cpp
251B
Happy Number
Happy Number.cpp
385B
Contains Duplicate II
Contains Duplicate II.cpp
1.3KB
Palindrome Number
Palindrome Number.cpp
558B
Combinations
Combinations.cpp
809B
Maximum Gap
Maximum Gap.cpp
1.9KB
Ugly Number
Ugly Number.cpp
365B
Bitwise AND of Numbers Range
Bitwise AND of Numbers Range.cpp
445B
Surrounded Regions
内容介绍
# leetcode
The optimum C++ solutions for the leetcode
这是我自己写的leetcode的题解,目前已经完成了70%左右,后续部分会很快更新
这里放上来的代码都能保证是最优解(复杂度最优)
当然有些题目因为测试数据等原因可能会和统计中最快的代码在时间上有常数的差距
希望对需要的人能有些帮助
1. Introduction 2. Array i. Remove Element ii. Remove Duplicates from Sorted Array iii. Plus One iv. Pascal's Triangle v. Merge Sorted Array vi. Sum vii. Find Minimum in ...viii....ix....x....xi....xii....xiii....xiv....