随笔分类 - LeetCode
摘要:Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha
阅读全文
摘要:Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have
阅读全文
摘要:There are n different online courses numbered from 1 to n. Each course has some duration(course length) tand closed on dth day. A course should be tak
阅读全文
摘要:Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an in
阅读全文
摘要:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could
阅读全文
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp
阅读全文
摘要:Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i
阅读全文
摘要:Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from two different arrays (each array picks one) and cal
阅读全文
摘要:Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth
阅读全文
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n
阅读全文
摘要:Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak
阅读全文
摘要:Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If
阅读全文
摘要:Design and implement a data structure for a compressed string iterator. It should support the following operations: next and hasNext. The given compre
阅读全文
摘要:Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is
阅读全文
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup
阅读全文
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep
阅读全文
摘要:Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they
阅读全文
摘要:Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h
阅读全文
摘要:Given an m * n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is repres
阅读全文
摘要:Given a positive integer n, find the number of non-negative integers less than or equal to n, whose binary representations do NOT contain consecutive
阅读全文

浙公网安备 33010602011771号