Skip to content

peiyan1234/LeetCode-CPP-efficient-solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

151 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodingSea

#0001:
Runtime: 12 ms, faster than 80.90% of C++ online submissions for Two Sum.
Memory Usage: 10.1 MB, less than 53.95% of C++ online submissions for Two Sum.

$0001:
Runtime: 20 ms, faster than 94.56% of C++ online submissions for Add Two Numbers.
Memory Usage: 71.3 MB, less than 80.81% of C++ online submissions for Add Two Numbers.

#0002:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Reverse Integer.
Memory Usage: 6.1 MB, less than 100.00% of C++ online submissions for Reverse Integer.

$0002:
Runtime: 8 ms, faster than 85.42% of C++ online submissions for Longest Substring Without Repeating Characters.
Memory Usage: 8.3 MB, less than 73.18% of C++ online submissions for Longest Substring Without Repeating Characters.

#0003:
Runtime: 8 ms, faster than 89.96% of C++ online submissions for Palindrome Number.
Memory Usage: 5.9 MB, less than 100.00% of C++ online submissions for Palindrome Number

$0003:
Runtime: 12 ms, faster than 93.77% of C++ online submissions for Longest Palindromic Substring.
Memory Usage: 9.1 MB, less than 63.02% of C++ online submissions for Longest Palindromic Substring.

#0004:
Runtime: 12 ms, faster than 75.27% of C++ online submissions for Roman to Integer.
Memory Usage: 6.1 MB, less than 100.00% of C++ online submissions for Roman to Integer.

#0005:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Longest Common Prefix.
Memory Usage: 9.3 MB, less than 6.45% of C++ online submissions for Longest Common Prefix.

#0006:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Valid Parentheses.
Memory Usage: 6.2 MB, less than 93.75% of C++ online submissions for Valid Parentheses.

#0007:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Merge Two Sorted Lists.
Memory Usage: 14.6 MB, less than 35.23% of C++ online submissions for Merge Two Sorted Lists.

#0008:
Runtime: 8 ms, faster than 99.93% of C++ online submissions for Remove Duplicates from Sorted Array.
Memory Usage: 13.9 MB, less than 45.84% of C++ online submissions for Remove Duplicates from Sorted Array.

#0009:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Remove Element.
Memory Usage: 9 MB, less than 44.78% of C++ online submissions for Remove Element.

#0010:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Implement strStr().
Memory Usage: 7.1 MB, less than 5.24% of C++ online submissions for Implement strStr().

#0011:
Runtime: 4 ms, faster than 99.13% of C++ online submissions for Search Insert Position.
Memory Usage: 10 MB, less than 99.99% of C++ online submissions for Search Insert Position.

#0012:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Count and Say.
Memory Usage: 7.3 MB, less than 14.93% of C++ online submissions for Count and Say.

#0013:
Runtime: 8 ms, faster than 96.25% of C++ online submissions for Maximum Subarray.
Memory Usage: 13.4 MB, less than 92.49% of C++ online submissions for Maximum Subarray.

#0014:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Length of Last Word.
Memory Usage: 6.7 MB, less than 98.97% of C++ online submissions for Length of Last Word.

#0015:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Plus One.
Memory Usage: 9.2 MB, less than 73.93% of C++ online submissions for Plus One.

#0016:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Add Binary.
Memory Usage: 6.5 MB, less than 95.18% of C++ online submissions for Add Binary.

#0017:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Sqrt(x).
Memory Usage: 6.2 MB, less than 89.91% of C++ online submissions for Sqrt(x).

#0018:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Climbing Stairs.
Memory Usage: 6.2 MB, less than 91.52% of C++ online submissions for Climbing Stairs.

#0019: Runtime: 8 ms, faster than 98.56% of C++ online submissions for Remove Duplicates from Sorted List.
Memory Usage: 12 MB, less than 90.70% of C++ online submissions for Remove Duplicates from Sorted List.

#0020:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Merge Sorted Array.
Memory Usage: 9.4 MB, less than 83.49% of C++ online submissions for Merge Sorted Array.

#0021:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Same Tree.
Memory Usage: 10.4 MB, less than 66.01% of C++ online submissions for Same Tree.

#0022: Runtime: 0 ms, faster than 100.00% of C++ online submissions for Symmetric Tree.
Memory Usage: 16.2 MB, less than 93.33% of C++ online submissions for Symmetric Tree.

#0023:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Maximum Depth of Binary Tree.
Memory Usage: 18.8 MB, less than 93.69% of C++ online submissions for Maximum Depth of Binary Tree.

#0024:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Binary Tree Level Order Traversal II.
Memory Usage: 12.7 MB, less than 66.43% of C++ online submissions for Binary Tree Level Order Traversal II.

#0025:
Runtime: 8 ms, faster than 99.91% of C++ online submissions for Convert Sorted Array to Binary Search Tree.
Memory Usage: 20.5 MB, less than 100.00% of C++ online submissions for Convert Sorted Array to Binary Search Tree.

#0026:
Runtime: 4 ms, faster than 98.70% of C++ online submissions for Balanced Binary Tree.
Memory Usage: 20.9 MB, less than 47.24% of C++ online submissions for Balanced Binary Tree.

#0027:
Runtime: 212 ms, faster than 91.31% of C++ online submissions for Minimum Depth of Binary Tree.
Memory Usage: 144.5 MB, less than 96.81% of C++ online submissions for Minimum Depth of Binary Tree.

#0028:
Runtime: 4 ms, faster than 98.49% of C++ online submissions for Path Sum.
Memory Usage: 21.1 MB, less than 85.81% of C++ online submissions for Path Sum.

#0029:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Binary Tree Inorder Traversal.
Memory Usage: 7.9 MB, less than 98.87% of C++ online submissions for Binary Tree Inorder Traversal.

#0030:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Pascal's Triangle.
Memory Usage: 6.4 MB, less than 86.99% of C++ online submissions for Pascal's Triangle.

#0031:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Pascal's Triangle II.
Memory Usage: 6.2 MB, less than 86.74% of C++ online submissions for Pascal's Triangle II.

#0032:
Runtime: 100 ms, faster than 95.79% of C++ online submissions for Best Time to Buy and Sell Stock.
Memory Usage: 93.3 MB, less than 85.12% of C++ online submissions for Best Time to Buy and Sell Stock.

#0033:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Best Time to Buy and Sell Stock II.
Memory Usage: 13 MB, less than 84.93% of C++ online submissions for Best Time to Buy and Sell Stock II.

#0034:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Valid Palindrome.
Memory Usage: 7.3 MB, less than 80.54% of C++ online submissions for Valid Palindrome.

#0035:
Runtime: 4 ms, faster than 99.98% of C++ online submissions for Single Number.
Memory Usage: 17.1 MB, less than 22.63% of C++ online submissions for Single Number.

#0036:
Runtime: 4 ms, faster than 99.89% of C++ online submissions for Linked List Cycle.
Memory Usage: 7.9 MB, less than 79.20% of C++ online submissions for Linked List Cycle.

#0037:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Binary Tree Preorder Traversal.
Memory Usage: 8.4 MB, less than 41.67% of C++ online submissions for Binary Tree Preorder Traversal.

#0038:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Binary Tree Postorder Traversal.
Memory Usage: 7.8 MB, less than 99.63% of C++ online submissions for Binary Tree Postorder Traversal.

#0039:
Runtime: 16 ms, faster than 97.15% of C++ online submissions for Min Stack.
Memory Usage: 16.2 MB, less than 91.95% of C++ online submissions for Min Stack.

#0040:
Runtime: 36 ms, faster than 96.32% of C++ online submissions for Intersection of Two Linked Lists.
Memory Usage: 14.6 MB, less than 30.88% of C++ online submissions for Intersection of Two Linked Lists.

#0041:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Two Sum II - Input array is sorted.
Memory Usage: 9.8 MB, less than 5.88% of C++ online submissions for Two Sum II - Input array is sorted.

#0042:
Runtime: 0 ms, faster than 100.00% of C++ online submissions for Invert Binary Tree.
Memory Usage: 10.1 MB, less than 6.22% of C++ online submissions for Invert Binary Tree.

About

Recording submitted C++ code on Leetcode website

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages