看一下题目大意: 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.。 自己翻译一下,不难 ...
分类:
其他好文 时间:
2020-05-25 12:06:37
阅读次数:
75
1038 Recover the Smallest Number (30分) Given a collection of number segments, you are supposed to recover the smallest number from them. For example, ...
分类:
编程语言 时间:
2020-05-25 00:13:01
阅读次数:
66
Description: Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible ...
分类:
其他好文 时间:
2020-05-15 00:34:42
阅读次数:
86
题目描述 给定一个二叉搜索树,编写一个函数?kthSmallest?来查找其中第?k?个最小的元素。 说明: 你可以假设 k 总是有效的,1 ≤ k ≤ 二叉搜索树元素个数。 示例: 题目链接: https://leetcode cn.com/problems/kth smallest elemen ...
分类:
其他好文 时间:
2020-05-06 12:02:09
阅读次数:
46
问题: 求给定数组中两两元素之差,从小到大第k个差是多少 Example 1: Input: nums = [1,3,1] k = 1 Output: 0 Explanation: Here are all the pairs: (1,3) -> 2 (1,1) -> 0 (3,1) -> 2 Th ...
分类:
其他好文 时间:
2020-05-04 15:42:43
阅读次数:
48
题目 https://leetcode cn.com/problems/find the kth smallest sum of a matrix with sorted rows/ 给你一个 m n 的矩阵 mat,以及一个整数 k ,矩阵中的每一行都以非递减的顺序排列。 你可以从每一行中选出 1 ...
分类:
编程语言 时间:
2020-05-03 20:16:18
阅读次数:
80
link class Solution { public: struct Comp{ bool operator()(vector<int>& v1, vector<int>& v2){ return v1[0]+v1[1]>v2[0]+v2[1]; } }; int kthSmallest(vec ...
分类:
其他好文 时间:
2020-05-03 20:13:29
阅读次数:
92
You are given an m * n matrix, mat, and an integer k, which has its rows sorted in non-decreasing order. You are allowed to choose exactly 1 element f ...
分类:
其他好文 时间:
2020-05-03 18:14:33
阅读次数:
59
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains ...
分类:
其他好文 时间:
2020-05-02 14:56:53
阅读次数:
58
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l ...
分类:
其他好文 时间:
2020-03-29 11:03:55
阅读次数:
74