1 class Solution: 2 def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]: 3 sorted_nums = sorted(nums) 4 n = len(nums) 5 index = 0 6 dic ...
分类:
其他好文 时间:
2020-03-01 14:29:42
阅读次数:
56
Feb 24, 2020 ~ Mar 1, 2020 Algorithm Problem 371. Sum of Two Integers(两整数之和) "题目链接" 题目描述:给定两个数字,求两个数字之和。不能使用加法运算 思路为:不能使用加法运算,那么可以考虑使用位运算来实现加法。先观察只有一位 ...
分类:
其他好文 时间:
2020-03-01 12:45:50
阅读次数:
63
jQuery敲代码过程中的错误 注意:组合选择器表示方式,例如:$("span, two") ...
分类:
Web程序 时间:
2020-02-29 22:14:50
阅读次数:
77
108. Convert Sorted Array to Binary Search Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this ...
分类:
编程语言 时间:
2020-02-29 22:03:51
阅读次数:
78
Flip game is played on a rectangular 4x4 field with two sided pieces placed on each of its 16 squares. One side of each piece is white and the other o ...
分类:
其他好文 时间:
2020-02-29 11:35:54
阅读次数:
90
全篇都是讲数字之间的运算的: 由上自下难度逐渐升级 ,没耐心者建议一拉到底: 1000: Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of ...
分类:
编程语言 时间:
2020-02-29 00:34:16
阅读次数:
85
1. 内建属性 2. 内建函数 range map filter reduce sorted 1. 内建属性 python3中查看类的内建属性和方法: 1 >>> class Person: 2 ... pass 3 ... 4 >>> dir(Person) 5 ['__class__', '__ ...
分类:
其他好文 时间:
2020-02-28 21:08:38
阅读次数:
109
eg:例如你调用了一个新增的接口,以往功能测试的话,你再web端新增一个店铺之后,你肯定要去数据库中查看,这些数据插入的对不对,是否正确的插入了每个字段 # 比较两个字典部分是否相等 def compare_two_dict(dict1, dict2, key_list): flag = True ...
分类:
编程语言 时间:
2020-02-28 15:47:19
阅读次数:
72
最多有两个不同字符的最长子串。题意是给一个字符串,请返回一个最长子串的长度。子串的要求是最多只有两个不同的字母。例子, Example 1: Input: "eceba" Output: 3 Explanation: tis "ece" which its length is 3. Example ...
分类:
其他好文 时间:
2020-02-28 13:52:03
阅读次数:
68
在幼儿园的时候,我们就学习过把一个数分成$a$与$b$,我们只需要用计算机来模拟这个过程就可以了。 我们先从奇数开始看起,以$5$为例: 我们可以发现,$5$可以分成$1$和$4$,$2$和$3$,$3$和$2$,以及$4$和$1$,也就是说,一个奇数可以有$n 1$种方法进行分解,去重后也就是$( ...
分类:
其他好文 时间:
2020-02-28 12:25:22
阅读次数:
66