- 博客(34)
- 资源 (1)
- 收藏
- 关注
原创 #leetcode#Longest Palindromic Substring
Longest Palindromic Substring Total Accepted: 55519 Total Submissions: 267875My SubmissionsQuestion Solution Given a string S, find the longest palindromic substring in S. You ma
2015-06-30 03:03:51 530
原创 #leetcode#Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return 5.
2015-06-29 15:20:40 470
原创 #leetcode#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 non
2015-06-27 01:26:38 565
原创 #leetcode#Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:
2015-06-26 07:27:09 804
原创 #Design#File System Design
http://web.stanford.edu/~ouster/cgi-bin/papers/lfs.pdfhttp://web.mit.edu/6.033/1997/handouts/html/04sfs.htmlhttp://pages.cs.wisc.edu/~remzi/OSTEP/file-implementation.pdf
2015-06-26 06:47:24 941
原创 #leetcode#Contains Duplicates III
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] andnums[j] is at most t and the difference between i and
2015-06-26 03:09:09 470
原创 #leetcode#Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.Hide Tags Hash Table MathHard题目其实也是难了不会, 会了不难。。。分
2015-06-25 10:56:25 539
原创 #leetcode#Course Schedule II
感觉用BFS来做拓扑排序的做法掌握的差不多了, 但是DFS做法还没写过。。用了两个hashmap,一个用来存每个节点的入度, 另外一个存当前节点对其指向节点的映射初始化两个hashmap时i和j的值弄晕了。。还有最后不要忘记判断是否有有效解public class Solution { public int[] findOrder(int numCourses, int[]
2015-06-24 11:09:20 533
原创 #leetcode#Course Schedule
There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as
2015-06-24 09:33:47 511
原创 #leetcode#Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [
2015-06-18 12:01:14 486
原创 #leetcode#Merge K Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Divide and Conquer Linked List Heap思路:方法1, 利用merge
2015-06-16 08:00:28 568
原创 #leetcode#Rectangle Area
Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the tota
2015-06-16 02:35:50 566
原创 #leetcode#Next Permuatation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2015-06-15 17:59:57 484
原创 #leetcode#Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""3
2015-06-15 13:09:28 709
原创 #leetcode#Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.借鉴 https://leetcodenotes.wordpre
2015-06-14 14:46:52 462
原创 #leetcode#Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal i
2015-06-14 12:21:38 683
原创 #leetcode#Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i
2015-06-14 11:47:03 425
原创 #leetcode#Divide Two Integers
Difference between >>> and >>:http://stackoverflow.com/a/2811372/2345313学习了code ganker大神的代码, 自己实际写的时候还是漏洞百出, 比如typo,还有忘记把dividend 和 divisor赋值成相应的绝对值, 举个例子: 129 / 7, 除法其实就是看129里有多少个7, 常规思路可以while
2015-06-14 09:48:00 606
原创 #leetcode#Implement Stack using Queues
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whet
2015-06-13 15:27:51 491
原创 #leetcode#Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node.
2015-06-12 14:18:13 474
原创 #leetcode#Sounded Regions
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O X
2015-06-12 13:52:58 511
原创 #leetcode#Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1
2015-06-12 05:52:35 401
原创 #leetcode#Longest Consecutive Sqeuence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3
2015-06-11 12:25:39 670
原创 #leetcode#Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on
2015-06-11 10:38:12 569
原创 #leetcode#Text Justification
L家高频题....毫无头绪, 学习了code ganker大神的解法,做了适当注释package TextJustification;import java.util.*;public class Solution { public ArrayList fullJustify(String[] words, int L) { ArrayList res = new ArrayL
2015-06-11 09:12:15 559
原创 #leetcode#Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0
2015-06-06 07:01:22 505
原创 #面经准备#RSA EMC
下周有RSA的面试, 发现几个面经,总结一下。What kind of security tests can be performed for a web application? how to come up a idea to make a JVM machine runs faster? -------------------------
2015-06-06 04:43:53 814
转载 #面试准备#算法笔记
http://jeffe.cs.illinois.edu/teaching/algorithms/notes/Index of /teaching/algorithms/notesParent Directory0-cover.pdf00-intro.pdf01-recursion.pdf02-fft.pdf03-backtracking.pdf04-fastexpo.pd
2015-06-05 01:55:09 677
转载 #面试准备#Bug Free
【 以下文字转载自 JobHunting 讨论区 】发信人: DAOLAIAMENG (熊熊), 信区: JobHunting标 题: interview心得:我是如何做到bug free的发信站: BBS 未名空间站 (Sat Oct 25 16:53:23 2014, 美东)看到版上很多水平不错的同胞,经常因为一些bug而没拿到offer,非常可惜。分享一下,如何
2015-06-05 01:36:36 940
转载 #Company List#Startup
【 以下文字转载自 JobHunting 讨论区 】发信人: myukulele (ukulele), 信区: JobHunting标 题: 再分享两个startup list发信站: BBS 未名空间站 (Wed Feb 18 00:48:54 2015, 美东)http://sharespost.com/sharespost-100/list/https://equi
2015-06-05 01:35:47 519
转载 #Design#System Design准备
【 以下文字转载自 JobHunting 讨论区 】发信人: flamingos (flamingos), 信区: JobHunting标 题: 我的System Design总结发信站: BBS 未名空间站 (Mon Sep 8 02:49:55 2014, 美东)我的面试也结束了 因为知道FLAG这类公司都会问到System Design的问题 所以这次面试着重准备
2015-06-04 14:32:52 772
转载 #F面经#Facebook
把看到的FB面经集中整理到一个帖子里来吧, 随看随搬。---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2015-06-04 12:46:41 2417
原创 #leetcode#Word Ladder
Given two words (beginWord and endWord), and a dictionary, find the length of shortest transformation sequence from beginWord to endWord, such that:Only one letter can be changed at a timeEach int
2015-06-04 11:10:18 553
原创 #leetcode#Median of Two Sorted Arrays
网上各种各样的解答, 还是code ganker大牛的思路最简单明了。这里handle了一下invalid input, 用找 kth element of sorted arrays的思路, 所以每次递归k - posA 或者 k - posB也就不难理解了, 找第k个元素么, 砍掉小的半边, 就把砍掉的个数减去, 而砍掉大得部分的时候无需对k进行修改。if(num
2015-06-03 11:44:45 424
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人