1 """ 2 Given a set of distinct integers, nums, return all possible subsets (the power set). 3 Note: The solution set must not contain duplicate subse ...
分类:
其他好文 时间:
2020-02-27 00:43:40
阅读次数:
73
题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were in ...
分类:
编程语言 时间:
2020-02-26 14:13:14
阅读次数:
95
You are given a sequence b1,b2,…,bnb1,b2,…,bn . Find the lexicographically minimal permutation a1,a2,…,a2na1,a2,…,a2n such that bi=min(a2i?1,a2i)bi=mi ...
分类:
其他好文 时间:
2020-02-26 01:36:30
阅读次数:
97
题目链接:http://codeforces.com/contest/1311/problem/D 题意:有三个数a,b,c,且a<=b<=c。你每次可以选择一个数加1或减1,但不能变为非正数。要求尽可能少的操作完后,使得b%a=0,c%b=0。输出最少操作数,并输出最后的a,b,c。 思路:枚举第 ...
分类:
其他好文 时间:
2020-02-25 23:12:21
阅读次数:
56
1 """ 2 Given an array of strings, group anagrams together. 3 Example: 4 Input: ["eat", "tea", "tan", "ate", "nat", "bat"], 5 Output: 6 [ 7 ["ate","ea ...
分类:
其他好文 时间:
2020-02-25 23:04:37
阅读次数:
68
题目链接: "Three Integers" 简要题意: 给出 $a, b, c$ 满足 $a \leq b \leq c$。 你可以随便选择其中一个数,使这个数 $+1$ 或 $ 1$。 假设最后操作完 $a$ 为 $A$,$b$ 为 $B$,$c$ 为 $C$。 你需要使 $A | B$ 且 $ ...
分类:
其他好文 时间:
2020-02-25 18:12:59
阅读次数:
53
Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters ...
分类:
其他好文 时间:
2020-02-25 13:10:02
阅读次数:
53
Given n orders, each order consist in pickup and delivery services. Count all valid pickup/delivery possible sequences such that delivery(i) is always ...
分类:
其他好文 时间:
2020-02-25 13:02:43
阅读次数:
95
I have a NHibernate search function where I receive integers and want to return results where at least the beginning coincides with the integers, e.g. ...
分类:
Web程序 时间:
2020-02-25 11:14:17
阅读次数:
112
Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top ...
分类:
其他好文 时间:
2020-02-25 00:29:46
阅读次数:
84