给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
Given a collection of distinct integers, return all possible permutations.
给定一个包含红色、白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色、白色、蓝色顺序排列。
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
Given a collection of numbers, return all possible permutations.
//TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //TODO //T
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
给你一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?请你找出所有和为 0 且不重复的三元组。
LeetCode-HOT-100 力扣 (LeetCode) LeetCode 热题 HOT 100 ⚡ 如果你有问题 https://webvueblog.github.io/LeetCode-HOT
给定一个 m x n 二维字符网格 board 和一个字符串单词 word 。如果 word 存在于网格中,返回 true ;否则,返回 false 。
在一个从左到右,从上到下均有序的二维数组中,找到从小到第k个数字,这里需要注意,不要求一定要是唯一的值,即假设存在这样一个序列1,2,2,3,则第三个数字是2而不是3。
others = current total += current return total Reference https://leetcode.com /problems/calculate-money-in-leetcode-bank/
maxarea = Math.max(leftarea,rightarea,maxarea) } return maxarea }; 这样的效率虽然比暴力好一点能够通工leetcode
请你实现三个 API append,addAll 和 multAll 来实现奇妙序列。
题目描述 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may assume nums1 and nums2 cannot be both empty. Example 1: nums1 = [1,
参考 1.https://leetcode.com/contest/weekly-contest-91/problems/score-after-flipping-matrix/
leetcode_problem863 rank: medium 1.问题 给定一个二叉数(root),二叉树中一个node(target)以及整数K,求二叉树中所有与target距离K的节点值。 参考 1. https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/solution/ 2. https://leetcode.com
公司计划面试 2N 人。第 i 人飞往 A 市的费用为 costs[i][0],飞往 B 市的费用为 costs[i][1]。
遇到的输入链表如果没有空表头,一般给它加个空表头,便于设计算法,不用区分很多特殊情况。 如果算法可能设计前驱指针pre,则务必要加上空表头,因为当需要找到链表第一个节点的前驱指针时,没空表头会很难办。有空表头的话,第一个节点的前驱节点就是空表头。