原创 LeetCode----- 86.Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equa

原创 LeetCode----- 12.Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 解題思路:直接對輸入

原创 Leetcode----- 82.Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the origi

原创 LeetCode----- 31.Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.

原创 LeetCode----- 24.Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should ret

原创 LeetCode----- 2.Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse orde

原创 LeetCode----- 61. Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NU

原创 LeetCode----- 26. Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new len

原创 Android-----SharedPreences工具類

public class SharedPreUtil { private static SharedPreferences mSp = null; //緩存的config_sp.xml文件 private stat

原创 Android-----崩潰的log日誌捕捉

當用戶在使用程序的時候,遇到程序崩潰,但是程序員又不知道出現的是啥原因。解決方法:可以在自己自定義的Application中捕捉全局異常,將它寫入到本地文件中,再上傳到自己的服務器上面。 代碼如下: public class MyAppl

原创 LeetCode----- 16.3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retur

原创 Android-----Viewpager加載不出Fragment數據的情況

       原因:昨天再寫ViewPager+fragment+RadioButton佈局的時候,當點擊第4個RadioButton切換到第四個fragment,然後再點擊第一個RadioButton切換第一個fragment,再點擊第

原创 LeetCode----- 83.Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2

原创 LeetCode----- 34.Search for a Range

Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.

原创 LeetCode----- 19.Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: