随笔分类 -  LeetCode

摘要:Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2016-05-11 15:31 梦幻之海 阅读(206) 评论(0) 推荐(0)
摘要:Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s 阅读全文
posted @ 2016-05-05 21:28 梦幻之海 阅读(203) 评论(0) 推荐(0)
摘要:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2016-05-04 19:12 梦幻之海 阅读(435) 评论(0) 推荐(0)
摘要: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 or 阅读全文
posted @ 2016-03-25 14:19 梦幻之海 阅读(153) 评论(0) 推荐(0)
摘要:Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtime c 阅读全文
posted @ 2016-02-05 22:17 梦幻之海 阅读(167) 评论(0) 推荐(0)
摘要:Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n 阅读全文
posted @ 2016-02-01 13:39 梦幻之海 阅读(150) 评论(0) 推荐(0)