# 分享leetcode解题笔记

344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 继续阅读 »

# 分享Solution of Minimum Height Trees

I have trained my algorithm on leetcode a period of time. Today, I will explain my solution about Minimum Height Trees. My solution beat ~95% against others but it is hard to explain what is I do. Please allow me to introduce the solution from easy to hard. If you only need the last solution, jump to 继续阅读 »

# 分享LeetCode-Remove Nth Node From End of List

Question Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes 1->2->3->5. Note: Given n will always be valid. Try to do this in one pass. 解说 这道题的意思是，如何反向删 继续阅读 »

# 分享LeetCode-TwoSum

Question Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums + nums = 2 + 7 = 9, return [0, 1]. UPDATE (2016/2/13): The return forma 继续阅读 »