[TOC] 题目描述: 给定一个只包含小写字母的有序数组 和一个目标字母 ,寻找有序数组里面比目标字母大的最小字母。 数组里字母的顺序是循环的。举个例子,如果目标字母 并且有序数组为 ,则答案返回 。 示例: 注意: 1. 长度范围在 区间内。 2. 仅由小写字母组成,最少包含两个不同的字母。 3. ...
分类:
其他好文 时间:
2019-03-29 10:34:55
阅读次数:
164
Let's say we are given an array: We want to get K = 3 smallest items from the array and using Max heap data structure. So this is how to think about i ...
分类:
其他好文 时间:
2019-03-05 23:06:18
阅读次数:
188
Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t ...
分类:
其他好文 时间:
2019-02-28 14:50:58
阅读次数:
179
1038 Recover the Smallest Number (30 分) Given a collection of number segments, you are supposed to recover the smallest number from them. For example, ...
分类:
其他好文 时间:
2019-02-26 13:24:23
阅读次数:
201
Problem: Given an array A, we may rotate it by a non-negative integer K so that the array becomes A[K], A[K+1], A{K+2], ... A[A.length - 1], A[0], A[1 ...
分类:
其他好文 时间:
2019-02-10 09:15:23
阅读次数:
168
Description First we define: (1) $lcm(a,b)$, the least common multiple of two integers $a$ and $b$, is the smallest positive integer that is divisible ...
分类:
其他好文 时间:
2019-02-09 12:05:06
阅读次数:
158
题目如下: Given the root of a binary tree, each node has a value from 0 to 25representing the letters 'a' to 'z': a value of 0 represents 'a', a value of ...
分类:
其他好文 时间:
2019-02-06 15:52:32
阅读次数:
192
https://leetcode.com/problems/find-k-pairs-with-smallest-sums/ You are given two integer arrays nums1 and nums2 sorted in ascending order and an integ ...
分类:
其他好文 时间:
2019-02-06 11:52:53
阅读次数:
118
Q1: Find the smallest way from array: O(n), cannot be improved anymore, because we have to loop though the array once. Q2: Find 2nd smallest value, na ...
分类:
其他好文 时间:
2019-02-06 09:31:06
阅读次数:
211