How would you print just the 10th line of a file? For example, assume that file.txt has the following c…
分类:LeetCode题目解答
[LeetCode] Task Scheduler 任务行程表
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where differen…
[Algo] Print Matrix Diagonal 对角打印
Print Matrix Diagonal Print the matrix in diagonal way. For example: 1 2 3 4 5 6 7 8 Print: 1 2 5 6 3 4 7 8 双重…
[LeetCode] Remove Element 移除元素
Given an array and a value, remove all instances of that value in place and return the new length. The …
[Leetcode] Word Break 单词分解
Word Break I Given a string s and a dictionary of words dict, determine if s can be segmented into a space-sep…
[Leetcode] Find Minimum in Rotated Sorted Array 找旋转有序数组的最小值
Find Minimum in Rotated Sorted Array I Suppose a sorted array is rotated at some pivot unknown to you beforeha…
[LeetCode] Decode String 解码字符串
Given an encoded string, return it’s decoded string. The encoding rule is: k[encoded_string]…
LeetCode 015 3Sum
题目描述 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique …
[LeetCode] Paint House II 粉刷房子之二
There are a row of n houses, each house can be painted with one of the k colors. Th…
[LeetCode] Daily Temperatures 日常温度
Given a list of daily temperatures, produce a list that, for each day in the input, tells you how …
LeetCode | Valid Parentheses
题目: Given a string containing just the characters '(', ')', '{', '}', '[' and&nb…
LeetCode 066 Plus One
题目描述 Given a non-negative number represented as an array of digits, plus one to the number. The digits are sto…