码迷,mamicode.com
首页 >  
搜索关键字:smallest    ( 560个结果
【leetcode】1509. Minimum Difference Between Largest and Smallest Value in Three Moves
题目如下: Given an array nums, you are allowed to choose one element of nums and change it by any value in one move. Return the minimum difference between ...
分类:其他好文   时间:2020-09-17 22:48:12    阅读次数:35
LeetCode 632. Smallest Range Covering Elements from K Lists(632. 最小区间)
题目地址:632. 最小区间 You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k li ...
分类:其他好文   时间:2020-08-26 17:10:59    阅读次数:46
Leetcode: 632. Smallest Range Covering Elements from K Lists
Description You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists ...
分类:其他好文   时间:2020-07-19 15:47:40    阅读次数:73
[PAT] A1038 Recover the Smallest Number
(贪心、字符串) ##题目大意 给一些字符串,求它们拼接起来构成最小数字的方式 ##思路 贪心算法。用cmp排序,直接判断a+b和b+a的大小即可。 必须保证两个字符串构成的数字是最小的才行,所以cmp函数写成return a + b < b + a;的形式,保证它排列按照能够组成的最小数字的形式排 ...
分类:其他好文   时间:2020-07-13 14:04:47    阅读次数:60
[LeetCode 625] Minimum Factorization
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a. If there is no answer or the answer i ...
分类:其他好文   时间:2020-07-10 09:57:57    阅读次数:79
leetcode 378 有序矩阵中第k小的元素(二分 or 归并)
待整理https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/solution/you-xu-ju-zhen-zhong-di-kxiao-de-yuan-su-by-leetco/ ...
分类:其他好文   时间:2020-07-07 17:56:02    阅读次数:62
LeetCode 378. 有序矩阵中第K小的元素 | Python
378. 有序矩阵中第K小的元素 题目来源:力扣(LeetCode)https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix 题目 给定一个 n x n 矩阵,其中每行和每列元素均按升序排序,找到矩阵中第 k 小 ...
分类:编程语言   时间:2020-07-02 21:29:52    阅读次数:54
0041. First Missing Positive (H)
First Missing Positive (H) 题目 Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example ...
分类:其他好文   时间:2020-06-27 09:31:04    阅读次数:53
1202. Smallest String With Swaps
问题: 给定字符串s,和可进行交换的index对数组。 对字符串s的各个位置index,可根据交换数组所示的两两交换(次数不限),求进行交换后,可得最小的字符串。 Example 1: Input: s = "dcab", pairs = [[0,3],[1,2]] Output: "bacd" E ...
分类:其他好文   时间:2020-06-20 15:49:13    阅读次数:53
A Simple Problem
For a given positive integer n, please find the smallest positive integer x that we can find an integer y such that y^2 = n +x^2. Input The first line ...
分类:其他好文   时间:2020-05-25 19:26:17    阅读次数:61
560条   上一页 1 2 3 4 ... 56 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!