上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 28 下一页
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You shoul... 阅读全文
posted @ 2015-05-16 18:29 TonyLuis 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100".解题思路:JAVA实现如下:static public String addBinar... 阅读全文
posted @ 2015-05-16 11:56 TonyLuis 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
posted @ 2015-05-16 11:08 TonyLuis 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for t... 阅读全文
posted @ 2015-05-16 10:56 TonyLuis 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N... 阅读全文
posted @ 2015-05-16 10:19 TonyLuis 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2015-05-15 23:57 TonyLuis 阅读(154) 评论(0) 推荐(0) 编辑
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po... 阅读全文
posted @ 2015-05-15 21:50 TonyLuis 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->... 阅读全文
posted @ 2015-05-15 21:21 TonyLuis 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 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 ... 阅读全文
posted @ 2015-05-15 20:43 TonyLuis 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3,You should return the followin... 阅读全文
posted @ 2015-05-15 19:59 TonyLuis 阅读(146) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 28 下一页