摘要: public static int[] TwoSum(int[] nums, int target) { int[] result = new int[2]; //key为数值,value为它的索引值 Dictionary temp = new Dictionary(); ... 阅读全文
posted @ 2016-10-31 23:41 pzhang22 阅读(141) 评论(0) 推荐(0) 编辑
摘要: public int MyAtoi(string str) { if (string.IsNullOrEmpty(str)) { return 0; } int sign = 1; int i = 0; ... 阅读全文
posted @ 2016-10-31 23:13 pzhang22 阅读(117) 评论(0) 推荐(0) 编辑
摘要: public int Reverse(int input) { long reversedNum = 0; while (input != 0) { reversedNum = reversedNum * 10 + input % 10; ... 阅读全文
posted @ 2016-10-31 23:11 pzhang22 阅读(60) 评论(0) 推荐(0) 编辑
摘要: public string Convert(string s, int numRows) { if (numRows <= 1 || s.Length == 0) { return s; } string res = ""; ... 阅读全文
posted @ 2016-10-31 23:09 pzhang22 阅读(94) 评论(0) 推荐(0) 编辑
摘要: public double FindMedianSortedArrays(int[] nums1, int[] nums2) { int m = nums1.Length; int n = nums2.Length; int total = m + n; if (tot... 阅读全文
posted @ 2016-10-31 23:08 pzhang22 阅读(123) 评论(0) 推荐(0) 编辑
摘要: public int LengthOfLongestSubstring(string s) { int[] mOccur = new int[256]; int maxL = 0; char[] schar = s.ToCharArray(); for (int i = 0, j = 0; i 1) ... 阅读全文
posted @ 2016-10-31 23:04 pzhang22 阅读(58) 评论(0) 推荐(0) 编辑
摘要: public class ListNode { public int val; public ListNode next; public ListNode(int x) { val = x; } } public class Solution { public ListNode AddT... 阅读全文
posted @ 2016-10-31 22:59 pzhang22 阅读(83) 评论(0) 推荐(0) 编辑