”���LeetCode“ 的搜索结果

     Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT. Thesamerepeated number may be chosen fromCunlimited ...

     合并两个排序的链表 题目描述 输入两个单调递增的链表,输出两个链表合成后的链表,要求合成后的链表满足单调不减规则。 解: /* public class ListNode { int val; ListNode next = null;... public ListNode Merge...

     给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。...

     反转链表 public class ListNode{ ListNode next = null; int value; public ListNode(int data){ this.value=data; } } public static void reverseList(ListNode head){ ListNode pre = null;... temp = hea

     呼呼呼~开始刷算法题了,过程注定痛苦但是能看到自己的成长也是很快乐的事情啊!加油!!! 题目: 两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们...

     题目: 无重复字符的最长子串 给定一个字符串,请你找出其中不含有重复字符的最长子串的长度。 用滑动窗口法求解 class Solution{ public int lengthOfLongestSubstring(String s){ int len = s.length();...

     Question: Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that: Only one letter can be ...

     Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT. Each number inCmay only be usedoncein the combin...

     刷刷刷 6.3-Longest Substring Without Repeating Characters-Difficulty: Medium Given a string, find the length of the longest substring without repeating characters. For example, the longest substring

     11.9-Palindrome Number-Difficulty: Easy Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes?...

     Then-queens puzzle is the problem of placingnqueens on ann�nchessboard such that no two queens attack each other.   Given an integern, return all distinct solutions t...

     最大连续1的个数 给定一个二进制数组, 计算其中最大连续1的个数。 示例 1: 输入: [1,1,0,1,1,1] 输出: 3 解释: 开头的两位和最后的三位都是连续1,所以最大连续1的个数是 3. 注意: 输入的数组只包含 0 和1。...

     Leetcode 53QuestionSolutionNotes Question Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. example Input: [-2...

     给定一个包含电话号码列表(一行一个电话号码)的文本文件 file.txt,写一个单行 bash 脚本输出所有有效的电话号码。 你可以假设一个有效的电话号码必须满足以下两种格式: (xxx) xxx-xxxx 或 xxx-xxx-xxxx。...

     Question Sort a linked list in O(n log n) time using constant space complexity. Solution Since the time complexity is O(nlogn), so we can use merge sort. /** * Definition for singly-linked list. ...

     Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "...

     leetcode 48.旋转图像 题目描述 给定一个 n × n 的二维矩阵表示一个图像。 将图像顺时针旋转 90 度。 说明: 你必须在原地旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要使用另一个矩阵来旋转图像。 示例...

     The n-queens puzzle is the problem of placing n queens on an n�n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle....

     Question: Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->...NUL...

     33. 搜索旋转排序数组题目描述解答 题目描述 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组 [0,1,2,4,5,6,7] 可能变为 [4,5,6,7,0,1,2] )。 搜索一个给定的目标值,如果数组中存在这个目标...

     三个数的最大乘积 给定一个整型数组,在数组中找出由三个数组成的最大乘积,并输出这个乘积。 示例 1: 输入: [1,2,3] 输出: 6 示例 2: 输入: [1,2,3,4] 输出: 24 ...给定的整型数组长度范围是[3,104],数组中所有的...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1