摘要:
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... 阅读全文
摘要:
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
摘要:
Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文
摘要:
Write a function to find the longest common prefix string amongst an array of strings. 直接按第一个元素开始比较,最后截取符合要求的前段。 Python版本 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 数组中间值置为root,然后对于两边的两块数组再调用该函数。 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.链表转换为BST,找到最中间的node设置为树的root,然后截断(设null),... 阅读全文
摘要:
创建正则表达式var re = new RegExp('parameter1','parameter2');var re = /parameter1/parameter2;g 全文查找,icase-insensitive,m 多行查找var re = new RegExp('a','gi');// ... 阅读全文
摘要:
Rat AttackInput:standard inputOutput:standardoutputTime Limit:7 secondsMemory Limit:32 MBBaaaam! Another deadly gas bomb explodes in Manhattan’sunderw... 阅读全文