摘要:
解题思路:本题是一道图的题目,但是无向图,给定的输入是图的各个边,题目中给出一个关键信息(Each node has labels in the set {0, 1, ..., edges.length})可知图中没有环,如果是有环的图这个题是无解的。最好的证明方法就是反正法,如果有环的话标号最大 阅读全文
摘要:
Problem statement In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this w 阅读全文
摘要:
Problem statement Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or 阅读全文
摘要:
Problem statement Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overl 阅读全文
摘要:
Problem statement You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c 阅读全文
摘要:
Problem statement The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got dupli 阅读全文
摘要:
Problem statement Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return t 阅读全文
摘要:
Problem statement Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English le 阅读全文