leetcode
guoyuhaoaaa
这个作者很懒,什么都没留下…
展开
-
472. Concatenated Words
周日参加了leetcode的contest,莫名其妙的被这道题卡住了,给出的反馈是内存超出,就觉得很郁闷,经过今天的好好研究终于发现了原因(根据错误样例反推原因)。 Given a list of words, please write a program that returns all concatenated words in the given list of words.A concat原创 2016-12-19 16:17:02 · 688 阅读 · 0 评论 -
115. Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of原创 2017-01-17 10:11:58 · 294 阅读 · 0 评论 -
220. Contains Duplicate III
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference b原创 2017-01-17 15:17:54 · 438 阅读 · 0 评论 -
312. Burst Balloons
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[lef原创 2017-01-18 09:49:51 · 334 阅读 · 0 评论 -
493. Reverse Pairs
Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the given array. Example1:Input: [1,3,2,3,1]原创 2017-02-12 16:33:26 · 1703 阅读 · 0 评论 -
491. Increasing Subsequences
Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 .Example: Input: [4原创 2017-01-30 09:50:57 · 356 阅读 · 0 评论 -
483. Smallest Good Base
For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1.Now given a string representing n, you should return the smallest good base of n in string format. The range of n is [3,原创 2017-01-30 10:07:22 · 1803 阅读 · 0 评论 -
Super Ugly Number
Write a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7, 8, 13, 14, 16,原创 2017-02-01 10:39:50 · 252 阅读 · 0 评论 -
Median of Two Sorted Arrays
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 should be O(log (m+n)).double findKth(int a[], int m,原创 2017-03-12 11:10:22 · 477 阅读 · 0 评论