摘要: Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.最简单的思路,逐... 阅读全文
posted @ 2014-12-27 21:38 H5开发技术 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that the... 阅读全文
posted @ 2014-12-26 21:59 H5开发技术 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Interleaving StringGivens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", r... 阅读全文
posted @ 2014-12-25 22:54 H5开发技术 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Canvas1.所有的UI元件都需要放在Canvas里2.UI元件的绘制顺序,与在 Hierarchy的顺序相同,在上面的元素会先被绘制,位于后续绘制元素的下面3.可以选择3种不同的渲染模式:Screen Space - Overlay类似于深度摄像机,会将UI渲染到游戏场景的最前面Screen S... 阅读全文
posted @ 2014-12-25 19:18 H5开发技术 阅读(444) 评论(0) 推荐(0) 编辑
摘要: Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字有如下符号:基本字符IVXLCDM阿拉伯数字15... 阅读全文
posted @ 2014-12-24 22:36 H5开发技术 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Valid SudokuDetermine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are ... 阅读全文
posted @ 2014-12-24 22:06 H5开发技术 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Sort ListSort a linked list inO(nlogn) time using constant space complexity.需要采用归并排序对链表进行操作。归并排序思想:每次选取链表中间元素,把链表分割成两部分,递归分割,直到链表中的元素是有序的时候(即只有一个元素时候)... 阅读全文
posted @ 2014-12-24 21:24 H5开发技术 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Majority ElementGiven an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may ass... 阅读全文
posted @ 2014-12-24 18:44 H5开发技术 阅读(231) 评论(0) 推荐(0) 编辑
摘要: String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, plea... 阅读全文
posted @ 2014-12-21 22:23 H5开发技术 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Merge Sorted ArrayGiven two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that i... 阅读全文
posted @ 2014-12-21 21:05 H5开发技术 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Trapping Rain WaterGivennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to tr... 阅读全文
posted @ 2014-12-21 20:49 H5开发技术 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Search in Rotated Sorted Array IIFollow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity... 阅读全文
posted @ 2014-12-20 23:03 H5开发技术 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Search in Rotated Sorted ArraySuppose 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).... 阅读全文
posted @ 2014-12-20 22:57 H5开发技术 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column TitleGiven a non-zero positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A ... 阅读全文
posted @ 2014-12-20 19:17 H5开发技术 阅读(204) 评论(0) 推荐(0) 编辑