发布时间:2015-06-29 19:24:24
注意 char+int 得到的还是int值 直接加到结果字符串上面<br />可以使用:sBuilder.append(Integer.toString(count)+lastChar);<br />sBuilder.append(""+count+lastChar);<br />避免问题<br />//The count-and-say sequence is the sequence of integers beginning as follows:<br />//1, 11, 21, 1211, 111221, ...<b.........【阅读全文】
发布时间:2015-06-29 17:40:49
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;color:#333333;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;line-height:30px;white-space:normal;background-color:#FFFFFF;">//Write a program to solve a Sudoku puzzle by filling the empty cells.<br />//<b.........【阅读全文】
发布时间:2015-06-27 19:10:44
//Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.<br />//<br />//The Sudoku board could be partially filled, where empty cells are filled with the character '.'.<br />//<br />//<br />//A partially filled sudoku which is valid.<br />//<br />//Note:<br />//A valid Sud.........【阅读全文】
发布时间:2015-05-29 14:23:16
//Given a sorted array of integers, find the starting and ending position of a given target value.////Your algorithm's runtime complexity must be in the order of O(log n).////If the target is not found in the array, return [-1, -1].////For example,//Given [5, 7, 7, 8, 8, 10] and target value.........【阅读全文】
发布时间:2015-05-25 18:55:28
//Suppose a sorted array is rotated at some pivot unknown to you beforehand.////(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).////You are given a target value to search. If found in the array return its index, otherwise return -1.////You may assume no duplicate exists in the array.public .........【阅读全文】