Design an in-memory file system to simulate the following functions: ls: Given a path in string format.…
分类:LeetCode
[LeetCode] Erect the Fence 竖立栅栏
There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Y…
[LeetCode] Kill Process 结束进程
Given n processes, each process has a unique PID (process id) and its PPID (pa…
[LeetCode] Delete Operation for Two Strings 两个字符串的删除操作
Given two words word1 and word2, find the minimum number of steps required to make …
[LeetCode] Shortest Unsorted Continuous Subarray 最短无序连续子数组
Given an integer array, you need to find one continuous subarray that if you only sort this s…
[LeetCode] Distribute Candies 分糖果
Given an integer array with even length, where different numbers in this array represent diff…
[LeetCode] Out of Boundary Paths 出界的路径
There is an m by n grid with a ball. Given the start coordinate (i,j) of …
[LeetCode] Subtree of Another Tree 另一个树的子树
Given two non-empty binary trees s and t, check whether tree t has exactly the…
[LeetCode] Squirrel Simulation 松鼠模拟
There’s a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid…
[LeetCode] Maximum Vacation Days 最大化休假日
LeetCode wants to give one of its best employees the option to travel among N cities to colle…
[LeetCode] Permutation in String 字符串中的全排列
Given two strings s1 and s2, write a function to return true if s2 contains th…
[LeetCode] Reshape the Matrix 重塑矩阵
In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix int…