摘要:
For example:Given "25525511135", return ["255.255.11.135", "255.255.111.35"]. (Order does not matter) 首先我们要明确传统IP 地址的规律是分4个Part,每个Part是从0-255的数字 0-255 阅读全文
posted @ 2023-05-18 21:13
MarkLeeBYR
阅读(400)
评论(0)
推荐(0)
摘要:
public String fun(String a, String b) { if (a.length() > b.length()) { return sub(a, b); } else if (a.length() < b.length()) { return "-" + sub(b, a); 阅读全文
posted @ 2023-05-11 15:54
MarkLeeBYR
阅读(109)
评论(0)
推荐(0)
摘要:
public String add(String s1, String s2) { int m = s1.length(); int n = s2.length(); int carry = 0; StringBuilder sb = new StringBuilder(); for (int i 阅读全文
posted @ 2023-05-10 20:49
MarkLeeBYR
阅读(23)
评论(0)
推荐(0)
摘要:
public static int subArrayCount(int[] arr) { if (arr == null) { return 0; } int count = 0; int len = arr.length; //对于每一个i位置都求一遍他有多少个子数组(这里可以通过数学方法计算即可 阅读全文
posted @ 2023-05-06 00:31
MarkLeeBYR
阅读(79)
评论(0)
推荐(0)
摘要:
public int subarraySum(int[] nums, int k) { if(nums == null || nums.length < 1){ return 0; } int count = 0; int len = nums.length; for(int i = 0; i < 阅读全文
posted @ 2023-05-06 00:28
MarkLeeBYR
阅读(45)
评论(0)
推荐(0)
摘要:
dp[i][0] 表示第i天持有股票所得现金 dp[i][1] 表示第i天不持有股票所得最多现金 如果第i天持有股票即dp[i][0], 那么可以由两个状态推出来。 1、第i-1天就持有股票,那么就保持现状,所得现金就是昨天持有股票的所得现金 即:dp[i - 1][0] 2、第i天买入股票,所得现 阅读全文
posted @ 2023-05-02 00:00
MarkLeeBYR
阅读(57)
评论(0)
推荐(0)
浙公网安备 33010602011771号