地址 https://leetcode-cn.com/contest/weekly-contest-155/problems/smallest-string-with-swaps/ 给你一个字符串 s,以及该字符串中的一些「索引对」数组 pairs,其中 pairs[i] = [a, b] 表示字符 ...
分类:
其他好文 时间:
2019-09-28 23:30:49
阅读次数:
132
Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater locate ...
分类:
其他好文 时间:
2019-09-25 12:17:22
阅读次数:
110
Question You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one elemen ...
分类:
其他好文 时间:
2019-09-25 00:57:21
阅读次数:
105
https://leetcode-cn.com/problems/find-smallest-letter-greater-than-target/submissions/ ...
分类:
编程语言 时间:
2019-09-23 22:12:04
阅读次数:
114
Description: Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we have ...
分类:
其他好文 时间:
2019-09-23 13:39:54
阅读次数:
127
这是小川的第 412 次更新,第 444 篇原创 看题和准备 今天介绍的是 LeetCode 算法题中 Easy 级别的第 263 题(顺位题号是 1170 )。在一个非空字符串s上定义一个函数 ,该函数计算 中最小字符的出现频率。例如,如果 ,则 ,因为最小字符为 ,其频率为2。 现在,给定字符串 ...
分类:
其他好文 时间:
2019-09-23 09:55:24
阅读次数:
91
"Longest Subarray" 题意:一个数列,每个元素大小都在1到C之间,求一个最长的子串,满足在这个子串中1到C之间的每个数字要么出现0次,要么出现至少K次。 题解:$i$从1到n枚举右端点,维护一个$tree[j]$表示在$i$为右端点时以$j$为左端点可行的个数(这里的可行是指对于1到 ...
分类:
其他好文 时间:
2019-09-11 00:01:04
阅读次数:
105
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's ...
分类:
其他好文 时间:
2019-09-03 11:32:27
阅读次数:
70
题目如下: Let's define a function f(s) over a non-empty string s, which calculates the frequency of the smallest character in s. For example, if s = "dcce ...
分类:
其他好文 时间:
2019-08-31 23:28:00
阅读次数:
104
2019/08/25: L230, L226, L18, L234, L23 1. L230 Kth smallest element in BST 借助 Stack 或 LinkedList inorder traveresal, LinkedList会更快 ArrayList, LinkedLi ...
分类:
其他好文 时间:
2019-08-26 11:33:38
阅读次数:
86