上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页
摘要: Given an array, determine whether there are three elements A[i],A[j],A[k], such that A[i]A[twoLen]) return true; 9 if (twoLen!=-1 && A[i]>... 阅读全文
posted @ 2014-12-24 04:54 LiBlog 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears three times except for one. Find that single one. Note: We generalize this problem to: Given an arra 阅读全文
posted @ 2014-12-23 06:44 LiBlog 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears twice except for one. Find that single one.Analysis:Use XOR operation.Solution: 1 public class Solut... 阅读全文
posted @ 2014-12-23 04:46 LiBlog 阅读(113) 评论(0) 推荐(0) 编辑
摘要: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
posted @ 2014-12-23 00:36 LiBlog 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be o... 阅读全文
posted @ 2014-12-22 07:35 LiBlog 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2014-12-17 12:25 LiBlog 阅读(719) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist... 阅读全文
posted @ 2014-12-16 07:50 LiBlog 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Solution: 1 public class Solution { 2 ... 阅读全文
posted @ 2014-12-16 06:53 LiBlog 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.A better solution: 1 /** 2 * Definition for a po... 阅读全文
posted @ 2014-12-16 06:00 LiBlog 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 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-12-16 04:05 LiBlog 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 36 下一页