2. Add Two Numbers
僅記錄 /** * Definition for singly-linked list. * public class ListNode { * public int val; * public ListNode next; * public ListNode(int val=0, ListNode next=null) { * this.val ...
1910. Remove All Occurrences of a Substrin
解題 題目:https://leetcode.com/problems/remove-all-occurrences-of-a-substring/ 目標:删除s字串内所有出现的part 使用IndexOf(string)回報字串第一次出現時的所在索引 (以零為起始) 再來用while迴圈做移除字元Remove(索引, part字串長度)並重新回報...
1.Two Sum
解題 題目:https://leetcode.com/problems/two-sum/ 判斷nums陣列內任意兩數字相加得到目標值(target) 這邊利用兩個迴圈做兩數相加並使用判斷式判斷是否符合目標值(target)並輸出相加的兩數值 程式碼(C#) public class Solution { public int[] TwoSu...