LeetCode 解题报告 (31)-- 数字排列的下一项
原题如下:
>Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
原题如下:
>Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
原题如下:
>You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
据说这是面试中被问频率非常高的一个问题,下面做简单的记录:
Java 中的 java.util.Iterator
和 java.util.Enumeration
均可用来遍历 Java 中的集合框架(list,map,set 等)。
原题如下:
>Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
原题如下:
>Given an array and a value, remove all instances of that value in place and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
LeetCode 解题报告 (26)-- 消除有序数组中重复值 (常数空间)
原题如下:
>Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
LeetCode 解题报告 (23)-- 合并 k 个有序数组
原题如下:
>Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.LeetCode 解题报告 (22)-- 生成所有合法的嵌套括号
原题如下:
>Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
搜狗、百度、QQ 输入法的词库爬虫
本文主要讲述了通过 python 实现的用于下载搜狗、百度、QQ 三个输入法的词库的爬虫的实现原理。主要利用了 python 自带的
urllib2
、Queue
、re
、threading
模块,并分别通过单线程和多线程实现。最后会给出完整的源码地址。0%