上一页 1 2 3 4 5 6 ··· 14 下一页

2015年1月19日

Dungeon Game

摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文

posted @ 2015-01-19 13:04 Step-BY-Step 阅读(221) 评论(0) 推荐(0) 编辑

2015年1月16日

Maximum Gap

摘要: Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文

posted @ 2015-01-16 16:40 Step-BY-Step 阅读(245) 评论(0) 推荐(0) 编辑

Min Stack

摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文

posted @ 2015-01-16 16:06 Step-BY-Step 阅读(118) 评论(0) 推荐(0) 编辑

Excel Sheet Column Number

摘要: Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文

posted @ 2015-01-16 15:10 Step-BY-Step 阅读(169) 评论(0) 推荐(0) 编辑

Excel Sheet Column Title

摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文

posted @ 2015-01-16 15:06 Step-BY-Step 阅读(143) 评论(0) 推荐(0) 编辑

Factorial Trailing Zeroes

摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.最初想法是计算里面能被5整除的数字的个数(因为能被2整除的... 阅读全文

posted @ 2015-01-16 15:04 Step-BY-Step 阅读(121) 评论(0) 推荐(0) 编辑

2015年1月15日

Majority Element

摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文

posted @ 2015-01-15 17:38 Step-BY-Step 阅读(118) 评论(0) 推荐(0) 编辑

Largest Number

摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文

posted @ 2015-01-15 17:18 Step-BY-Step 阅读(122) 评论(0) 推荐(0) 编辑

Fraction to Recurring Decimal

摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文

posted @ 2015-01-15 16:59 Step-BY-Step 阅读(183) 评论(0) 推荐(0) 编辑

Compare Version Numbers

摘要: Compare two version numbersversion1andversion1.Ifversion1>version2return 1, ifversion1 Integer.valueOf(parts2[i])) return 1;10 if(Integer.... 阅读全文

posted @ 2015-01-15 15:21 Step-BY-Step 阅读(216) 评论(0) 推荐(0) 编辑

2014年11月8日

yahoo面经 第二弹

该文被密码保护。 阅读全文

posted @ 2014-11-08 15:58 Step-BY-Step 阅读(2) 评论(0) 推荐(0) 编辑

2014年10月24日

Maximum Product Subarray

摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文

posted @ 2014-10-24 09:40 Step-BY-Step 阅读(113) 评论(0) 推荐(0) 编辑

2014年10月23日

Find Minimum in Rotated Sorted Array II

摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文

posted @ 2014-10-23 09:27 Step-BY-Step 阅读(162) 评论(0) 推荐(0) 编辑

2014年10月16日

Find Minimum in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文

posted @ 2014-10-16 11:23 Step-BY-Step 阅读(162) 评论(0) 推荐(0) 编辑

2014年9月5日

Set Matrix Zeroes

摘要: Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?A s... 阅读全文

posted @ 2014-09-05 06:39 Step-BY-Step 阅读(159) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted List

摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文

posted @ 2014-09-05 05:29 Step-BY-Step 阅读(128) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted List II

摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文

posted @ 2014-09-05 05:27 Step-BY-Step 阅读(130) 评论(0) 推荐(0) 编辑

2014年8月29日

Edit Distance

摘要: Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol... 阅读全文

posted @ 2014-08-29 09:42 Step-BY-Step 阅读(133) 评论(0) 推荐(0) 编辑

2014年8月19日

Wildcard Matching

摘要: Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the e... 阅读全文

posted @ 2014-08-19 13:29 Step-BY-Step 阅读(207) 评论(0) 推荐(0) 编辑

Subclasses

摘要: Given a collection of numbers, return all possible subclasses. 1 public class Solution { 2 public List> permute(int[] num) { 3 ArrayList... 阅读全文

posted @ 2014-08-19 09:05 Step-BY-Step 阅读(221) 评论(0) 推荐(0) 编辑

2014年8月15日

Trapping Rain Water

摘要: Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo... 阅读全文

posted @ 2014-08-15 09:38 Step-BY-Step 阅读(126) 评论(0) 推荐(0) 编辑

2014年8月14日

Search Insert Position

摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... 阅读全文

posted @ 2014-08-14 09:01 Step-BY-Step 阅读(116) 评论(0) 推荐(0) 编辑

2014年8月12日

Substring with Concatenation of All Words

摘要: You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenati... 阅读全文

posted @ 2014-08-12 10:48 Step-BY-Step 阅读(137) 评论(0) 推荐(0) 编辑

2014年8月7日

Swap Nodes in Pairs

摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文

posted @ 2014-08-07 09:21 Step-BY-Step 阅读(120) 评论(0) 推荐(0) 编辑

Remove Element

摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文

posted @ 2014-08-07 08:49 Step-BY-Step 阅读(106) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted Array

摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文

posted @ 2014-08-07 08:46 Step-BY-Step 阅读(111) 评论(0) 推荐(0) 编辑

2014年8月6日

Letter Combinations of a Phone Number

摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文

posted @ 2014-08-06 13:45 Step-BY-Step 阅读(140) 评论(0) 推荐(0) 编辑

Remove Nth Node From End of List

摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文

posted @ 2014-08-06 13:37 Step-BY-Step 阅读(129) 评论(0) 推荐(0) 编辑

Valid Parentheses

摘要: Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文

posted @ 2014-08-06 10:51 Step-BY-Step 阅读(114) 评论(0) 推荐(0) 编辑

Merge k Sorted Lists

摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.第一遍: 1 public class Solution { 2 public ListNode m... 阅读全文

posted @ 2014-08-06 10:29 Step-BY-Step 阅读(139) 评论(0) 推荐(0) 编辑

2014年8月5日

Using an Interface as a Type

摘要: When you define a new interface, you are defining a new reference data type. You can use interface names anywhere you can use any other data type name... 阅读全文

posted @ 2014-08-05 13:41 Step-BY-Step 阅读(215) 评论(0) 推荐(0) 编辑

4Sum

摘要: Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ... 阅读全文

posted @ 2014-08-05 13:19 Step-BY-Step 阅读(218) 评论(0) 推荐(0) 编辑

Roman to Integer

摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 1 public class Solution { 2 public int ... 阅读全文

posted @ 2014-08-05 10:26 Step-BY-Step 阅读(147) 评论(0) 推荐(0) 编辑

3Sum Closest

摘要: Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文

posted @ 2014-08-05 10:01 Step-BY-Step 阅读(100) 评论(0) 推荐(0) 编辑

2014年8月1日

Palindrome Number

摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i... 阅读全文

posted @ 2014-08-01 10:42 Step-BY-Step 阅读(123) 评论(0) 推荐(0) 编辑

2014年7月31日

Median of Two Sorted Arrays

摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文

posted @ 2014-07-31 09:44 Step-BY-Step 阅读(103) 评论(0) 推荐(0) 编辑

2014年7月16日

Find the smallest number whose digits multiply to a given number n

摘要: Given a number ‘n’, find the smallest number ‘p’ such that if we multiply all digits of ‘p’, we get ‘n’. The result ‘p’ should have minimum two digits... 阅读全文

posted @ 2014-07-16 05:49 Step-BY-Step 阅读(294) 评论(0) 推荐(0) 编辑

2014年7月15日

A Product Array Puzzle

摘要: Given an array arr[] of n integers, construct a Product Array prod[] (of same size) such that prod[i] is equal to the product of all the elements of a... 阅读全文

posted @ 2014-07-15 07:01 Step-BY-Step 阅读(332) 评论(0) 推荐(0) 编辑

2014年6月17日

Google NACL 简介

摘要: Back to READMEGetting StartedThis page tells you how to install Native Client and run demos, both in and outside of the browser. On Linux and Mac OS X... 阅读全文

posted @ 2014-06-17 07:49 Step-BY-Step 阅读(649) 评论(0) 推荐(0) 编辑

What does addScalar do?

摘要: The JavaDoc says:SQLQuery org.hibernate.SQLQuery.addScalar(String columnAlias, Type type)Declare a scalar query resultI know whatexecuteScalaris in C#... 阅读全文

posted @ 2014-06-17 02:39 Step-BY-Step 阅读(154) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 14 下一页

导航