上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 35 下一页
摘要: 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 con... 阅读全文
posted @ 2015-07-16 18:28 gqtc 阅读(124) 评论(0) 推荐(0)
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 思路:实现两个整数的除法,不能使用乘法,除法和移位操作。首先想到的是减法,但 阅读全文
posted @ 2015-07-16 12:41 gqtc 阅读(122) 评论(0) 推荐(0)
摘要: 一:概述 正则表达式(RE)为高级文本模式匹配,以及搜索-替代等功能提供了基础。正则表达式(RE)是一些由字符和特殊符号组成的字符串,它们能匹配多个字符串。Python通过标准库的re模块支持正则表达式。 在Python中,有两种主要方法完成模式匹配:搜索(searching)和匹配(matchin 阅读全文
posted @ 2015-07-15 23:26 gqtc 阅读(266) 评论(0) 推荐(0)
摘要: 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 fo 阅读全文
posted @ 2015-07-15 16:48 gqtc 阅读(108) 评论(0) 推荐(0)
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文
posted @ 2015-07-14 22:29 gqtc 阅读(95) 评论(0) 推荐(0)
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路:要快速找到k个元素中的最小值,使用堆这种数据结构。找到最小值后,还需要知道该最小值出自哪个链表, 阅读全文
posted @ 2015-07-14 17:50 gqtc 阅读(118) 评论(0) 推荐(0)
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " 阅读全文
posted @ 2015-07-14 11:32 gqtc 阅读(93) 评论(0) 推荐(0)
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two end p 阅读全文
posted @ 2015-07-13 10:50 gqtc 阅读(116) 评论(0) 推荐(0)
摘要: Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elemen 阅读全文
posted @ 2015-07-12 21:35 gqtc 阅读(92) 评论(0) 推荐(0)
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2015-07-12 14:38 gqtc 阅读(80) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 35 下一页