1. 题目 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the…
分类:LeetCode题目解答
【leetcode】26. Remove Duplicates from Sorted Array 删除有序数组的重复元素
1. 题目 Given a sorted array, remove the duplicates in place such that each element appear only once and return …
【leetcode】27. Remove Element 删除数组指定值的元素
1. 题目 Given an array and a value, remove all instances of that value in place and return the new length. Do no…
【leetcode】28. Implement strStr() 字符串匹配KMP BM
1. 题目 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is …
【leetcode】29. Divide Two Integers 不能使用乘除法的整数除法
1. 题目 Divide two integers without using multiplication, division and mod operator. If it is overflow, return M…
【leetcode】30. Substring with Concatenation of All Words 精确匹配的子串集
1. 题目 You are given a string, s, and a list of words, words, that are all of the same length. Find all startin…
【leetcode】31. Next Permutation 数字序列的所有组合中比给定串大的下一个最小的串
1. 题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation…
【leetcode】32. Longest Valid Parentheses 最长的有效匹配括号子串长度
1. 题目 Given a string containing just the characters ‘(‘ and ‘)’, find the length of th…
【leetcode】33. Search in Rotated Sorted Array 循环有序数组的二分查找
1. 题目 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might be…
【leetcode】34. Search for a Range 给定数组的给定值的下标范围
1. 题目 Given a sorted array of integers, find the starting and ending position of a given target value. Your al…
【leetcode】35. Search Insert Position 给定数字插入有序数组的下标点
1. 题目 Given a sorted array and a target value, return the index if the target is found. If not, return the ind…
【leetcode】36. Valid Sudoku 给定的数独表格是否是满足规则的
1. 题目 Determine if a Sudoku is valid, according to: Sudoku Puzzles – The Rules. The Sudoku board could b…