发布时间:2015-03-15 10:43:01
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You should return [1,2,3,6,9,8,7,4,5].public static List<Integer> spiralOrder(int[][] matr.........【阅读全文】
发布时间:2015-03-07 11:10:30
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited number of times.Note:All numbers (including target) will .........【阅读全文】
发布时间:2015-03-05 09:16:01
Write a function to find the longest common prefix string amongst an array of strings.public class LongestCommonPrefix {public String longestCommonPrefix(String[] strs) {if(strs.length==0)return "";String tempString=strs[0]; for (int i = 1; i < strs.length; i++) { i.........【阅读全文】