先用read4拷贝到buf4,然后从buf4里读: """ The read4 API is already defined for you. @param buf, a list of characters @return an integer def read4(buf): # Below is ...
分类:
其他好文 时间:
2020-02-07 16:35:00
阅读次数:
78
A binary search tree is uniquely determined by a given ordered insertions of a sequence of positive integers. On the other hand, a given binary search ...
分类:
其他好文 时间:
2020-02-07 10:53:55
阅读次数:
85
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = ...
分类:
其他好文 时间:
2020-02-07 00:48:28
阅读次数:
65
You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o ...
分类:
其他好文 时间:
2020-02-06 23:22:15
阅读次数:
72
1 """ 2 Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. 3 Sort the array so that when ...
分类:
其他好文 时间:
2020-02-06 23:03:15
阅读次数:
84
1 """ 2 Intersection of Two Arrays 3 Given two arrays, write a function to compute their intersection. 4 Example 1: 5 Input: nums1 = [1,2,2,1], nums2 ...
分类:
其他好文 时间:
2020-02-06 23:00:09
阅读次数:
74
1 """ 2 Given a collection of intervals, merge all overlapping intervals. 3 Example 1: 4 Input: [[1,3],[2,6],[8,10],[15,18]] 5 Output: [[1,6],[8,10],[ ...
分类:
其他好文 时间:
2020-02-06 22:59:28
阅读次数:
72
Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123Output: 321Example 2: Input: -123Output: -321Example 3: Input: 120Ou ...
分类:
其他好文 时间:
2020-02-06 19:49:49
阅读次数:
65
1 """ 2 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. 3 A mapping of d ...
分类:
其他好文 时间:
2020-02-06 16:44:30
阅读次数:
70
1 """ 2 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 3 Example 1: 4 Input: "bab ...
分类:
其他好文 时间:
2020-02-06 16:22:50
阅读次数:
60