[leetcode] online judge题目汇总

Posted TigerMee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[leetcode] online judge题目汇总相关的知识,希望对你有一定的参考价值。

最近在leetcode online judge刷题,132道题也做了一半多,略有心得。另外这个online judge对题目没有分类,也没有说明难度,新人上手无法由浅入深,也不能集中练习某些类型的题目,因此这里做个题目的分类和难度说明,也算是自己的总结。难度从1星到5星,难度划分依据如下:

  • 1星:练手题。算法上没有难度,主要考察编码基础,主要要注意越界判断。例如,数据越界,参数为空(字符串为空,链表为NULL等)等等。
  • 2星:相当于算法教材简单的课后习题,套用标准算法就可以解决,找到合适的算法即可。
  • 3星:算法略有难度,可能是经典算法的某种变型,套用某个算法之后,需要做一些额外的工作(例如对结果集去重等等);同时对编码技巧也有要求。
  • 4星:比较难的算法题,需要先分析问题建模,然后找到合适的经典算法,同时对编码技巧也有要求
  • 5星:还没遇到,放在这里仅仅作为上界。online judge上不会也有很变态的算法题。

总体看来,BackTracking、Tree相关、List相关的三大类算法的题目最多,动态规划反而不多,也可能是还没有做到。

今天整理了一下,把solution放到了github上,https://github.com/TigerMee/leetcode_onlinejudge

BackTracking

[**] Generate Parentheses

[**] Restore IP Addresses

[**] Palindrome Partitioning

[**] Letter Combinations of a Phone Number

[**] Permutations

[**] Combination Sum

[**] Subsets

[***] Word Ladder

[***] Permutations II

[***] Combination Sum II

[***] Word Ladder II

[****] Sudoku Solver


Tree

[*]Maximum Depth of Binary Tree

[**]Binary Tree Zigzag Level Order Traversal

[**]Sum Root to Leaf Numbers

[***]Construct Binary Tree from Inorder and Postorder Traversal

Binary Tree Maximum Path Sum

Populating Next Right Pointers in Each Node

Populating Next Right Pointers in Each Node II

Flatten Binary Tree to Linked List

Path Sum

Path Sum II

Minimum Depth of Binary Tree

Balanced Binary Tree

Convert Sorted Array to Binary Search Tree

Binary Tree Level Order Traversal

Symmetric Tree

Same Tree

Validate Binary Search Tree

Unique Binary Search Trees

Unique Binary Search Trees II

Binary Tree Inorder Traversal


List

[**]Remove Duplicates from Sorted List

[**]Convert Sorted List to Binary Search Tree

[***]Remove Duplicates from Sorted List II

Reverse Linked List II

Rotate List

Reverse Nodes in k-Group

Swap Nodes in Pairs

Merge k Sorted Lists

Remove Nth Node From End of List

Add Two Numbers

Merge Two Sorted Lists


String

[**] Interleaving String

[**] Length of Last Word

[**] Longest Substring Without Repeating Characters  [Solution]

[**] Minimum Window Substring  [Solution]

[***] strStr  [Solution]


Dynamic Programming

[**] Maximum Subarray

[***] Palindrome Partitioning II

[***] Longest Palindromic Substring


Greedy

[**] Jump Game

[**] Jump Game II


Other

[*] Longest Common Prefix

[*] Palindrome Number

[*] Reverse Integer

[*] Pow(x, n)

[*] Valid Sudoku

[*] Valid Palindrome

[*] Valid Parentheses

[*] Remove Element

[*] Best Time to Buy and Sell Stock

[*] Pascal's Triangle

[*] Pascal's Triangle II

[*] Two Sum

[*] Search a 2D Matrix

[*]  Add Binary

[*]  Remove Duplicates from Sorted Array

[**] Triangle

[**] Best Time to Buy and Sell Stock II

[**] Sort Colors

[**] Minimum Path Sum

[**] Insert Interval

[**] Merge Intervals

[**] Next Permutation

[**] Divide Two Integers

[**] 3Sum

[**] 4Sum


以上是关于[leetcode] online judge题目汇总的主要内容,如果未能解决你的问题,请参考以下文章

HDU-1703 Online Judge (练习处理输入)

T^T online judge 1372其实这题题目这么短就是为了让你AK

详解OJ(Online Judge)中PHP代码的提交方法及要点

PKU Online Judge 1046 Square Number

TOJ4101.Guess Game(TOJ means Tianjin University Online Judge)(dp的思想,但这道题目是假dp)

HDU 1073 Online Judge