Day: July 23, 2018

Leetcode 444 Sequence Reconstruction 字符串化用拓扑排序

Leetcode 444 Sequence Reconstruction 字符串化用拓扑排序

题目表述 Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104. Reconstruction means building a shortest common supersequence of the sequences 

Leetcode 207 Course Schedule 判断有向图是否有环

Leetcode 207 Course Schedule 判断有向图是否有环

题目表述 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total 

Leetcode 210 Course Schedule 拓扑排序

Leetcode 210 Course Schedule 拓扑排序

题目表述 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total