用了python的set。为了效率,先做了预处理,并排序了。要注意,排序完才好预处理,否则i,j会对不上。 class Solution: def maxProduct(self, words: List[str]) -> int: maxProd = 0 words = sorted(words, ...
分类:
其他好文 时间:
2020-02-01 21:34:23
阅读次数:
75
1、题目 21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes ...
分类:
其他好文 时间:
2020-02-01 19:06:49
阅读次数:
102
1 利用数组进行数据处理 numpy数组可以将许多种数据处理任务表述为简洁的数组表达式,用数组表达式替换循环的做法,通常被称为矢量化。 例如:我们想要处理一组值(网格型)上计算函数sqrt(x^2 + y^2)。np.meshgrid函数接受两个一维数组,并产生两个二维矩阵(对应于两个数组中所有的( ...
分类:
编程语言 时间:
2020-02-01 16:34:23
阅读次数:
81
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of ...
分类:
其他好文 时间:
2020-02-01 16:13:15
阅读次数:
69
Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1 ...
分类:
其他好文 时间:
2020-02-01 16:07:53
阅读次数:
90
C.Two ArraysYou are given two integers n and m. Calculate the number of pairs of arrays (a,b) such that: the length of both arrays is equal to m;each ...
分类:
其他好文 时间:
2020-02-01 12:45:43
阅读次数:
197
You are given an array a consisting of 500000 integers (numbered from 1 to 500000). Initially all elements of a are zero. You have to process two type ...
分类:
其他好文 时间:
2020-02-01 10:57:47
阅读次数:
74
Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro ...
分类:
编程语言 时间:
2020-02-01 10:47:36
阅读次数:
78
You are given two integers nn and mm . Calculate the number of pairs of arrays (a,b)(a,b) such that: the length of both arrays is equal to mm ; each e ...
分类:
其他好文 时间:
2020-01-31 22:40:17
阅读次数:
78
https://radimrehurek.com/gensim/auto_examples/index.html#core-tutorials Calculate the similarity of any two course -Design a program to implement the ...
分类:
其他好文 时间:
2020-01-31 21:16:24
阅读次数:
140