上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要: Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the d... 阅读全文
posted @ 2015-06-30 10:56 lilixu 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
posted @ 2015-06-30 10:09 lilixu 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
posted @ 2015-06-29 12:49 lilixu 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings. 直接按第一个元素开始比较,最后截取符合要求的前段。 Python版本 阅读全文
posted @ 2015-06-29 10:48 lilixu 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2015-06-28 14:58 lilixu 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
posted @ 2015-06-28 14:16 lilixu 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 数组中间值置为root,然后对于两边的两块数组再调用该函数。 阅读全文
posted @ 2015-06-28 09:33 lilixu 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.链表转换为BST,找到最中间的node设置为树的root,然后截断(设null),... 阅读全文
posted @ 2015-06-28 08:51 lilixu 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 创建正则表达式var re = new RegExp('parameter1','parameter2');var re = /parameter1/parameter2;g 全文查找,icase-insensitive,m 多行查找var re = new RegExp('a','gi');// ... 阅读全文
posted @ 2015-06-27 16:25 lilixu 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Rat AttackInput:standard inputOutput:standardoutputTime Limit:7 secondsMemory Limit:32 MBBaaaam! Another deadly gas bomb explodes in Manhattan’sunderw... 阅读全文
posted @ 2015-06-27 10:22 lilixu 阅读(386) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页