摘要:
public static int[] TwoSum(int[] nums, int target) { int[] result = new int[2]; //key为数值,value为它的索引值 Dictionary temp = new Dictionary(); ... 阅读全文
摘要:
public int MyAtoi(string str) { if (string.IsNullOrEmpty(str)) { return 0; } int sign = 1; int i = 0; ... 阅读全文
摘要:
public int Reverse(int input) { long reversedNum = 0; while (input != 0) { reversedNum = reversedNum * 10 + input % 10; ... 阅读全文
摘要:
public string Convert(string s, int numRows) { if (numRows <= 1 || s.Length == 0) { return s; } string res = ""; ... 阅读全文
摘要:
public double FindMedianSortedArrays(int[] nums1, int[] nums2) { int m = nums1.Length; int n = nums2.Length; int total = m + n; if (tot... 阅读全文
摘要:
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) ... 阅读全文
摘要:
public class ListNode { public int val; public ListNode next; public ListNode(int x) { val = x; } } public class Solution { public ListNode AddT... 阅读全文