摘要: ①:暴力法 public class Solution { public int MaxProfit(int[] prices) { int finalProfit = 0; for (int i = 0; i < prices.Length-1; i++) { for (int j = i; j 阅读全文
posted @ 2021-11-22 17:45 奕心1999 阅读(30) 评论(0) 推荐(0)
摘要: ①:dp动态规划 public class Solution { public int LengthOfLIS(int[] nums) { int[] dp = new int[nums.Length]; for (int i = 0; i < nums.Length; i++) { dp[i] = 阅读全文
posted @ 2021-11-12 16:09 奕心1999 阅读(14) 评论(0) 推荐(0)
摘要: ①:Hash(字典) public static int[] Intersect(int[] nums1, int[] nums2) { var dict = new Dictionary<int, int>(); //数组1置为小数组,数组2置为大数组 if (nums1.Length > num 阅读全文
posted @ 2021-11-11 10:50 奕心1999 阅读(22) 评论(0) 推荐(0)
摘要: ①: public void Merge(int[] nums1, int m, int[] nums2, int n) { int size = m + n; for (int i = 0; i < nums2.Length; i++) { if (m < size) { nums1[m++] = 阅读全文
posted @ 2021-11-10 11:49 奕心1999 阅读(18) 评论(0) 推荐(0)
摘要: ①:两次遍历 时间复杂度为O(n平方) public int[] TwoSum(int[] nums, int target) { for (int i = 0; i < nums.Length; i++) { for (int j = i+1; j < nums.Length; j++) { if 阅读全文
posted @ 2021-11-10 11:06 奕心1999 阅读(22) 评论(0) 推荐(0)
摘要: ①:动态规划 url:经典动态规划问题(理解「无后效性」) - 最大子序和 - 力扣(LeetCode) (leetcode-cn.com)(从零开始剖析入门动态规划) public class Solution { public int MaxSubArray(int[] nums) { for 阅读全文
posted @ 2021-11-09 14:39 奕心1999 阅读(20) 评论(0) 推荐(0)
摘要: ①:用字典存储(内存消耗大) public class Solution { public bool ContainsDuplicate(int[] nums) { var dict = new Dictionary<int, int>(); for (int i = 0; i < nums.Len 阅读全文
posted @ 2021-11-09 11:24 奕心1999 阅读(21) 评论(0) 推荐(0)
摘要: -- 匹配超链接 function M.HyperTextFormat(content) local content = 'https://cn.bing.com/search?q=%E5%A5%87%E8%91%A9%E7%9A%84%E5%9F%9F%E5%90%8D&form=ANNTH1&r 阅读全文
posted @ 2021-11-01 10:36 奕心1999 阅读(476) 评论(0) 推荐(0)
摘要: Array = {row=0,col=0} Chess={ipos=0,jpos=0,chessturn=0} local array={} local isWin=false local isWhite=false local isBlack=true print("五子棋游戏开始:请输入你需要的 阅读全文
posted @ 2021-10-08 10:28 奕心1999 阅读(276) 评论(0) 推荐(0)
摘要: Unity3D JetBrainsRider + EmmyLua(更新)调试Lua - 简书 (jianshu.com) 转载一下 阅读全文
posted @ 2021-09-26 09:53 奕心1999 阅读(299) 评论(0) 推荐(0)