水下功夫做透,水上才能顺风顺水。
上一页 1 2 3 4 5 6 7 8 9 ··· 40 下一页
摘要: public class Solution { public String longestPalindrome(String s) { int len = s.length(); if (len < 2) { return s; } int maxLen = 1; int begin = 0; // 阅读全文
posted @ 2022-09-23 11:20 北方寒士 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 1. apollo配置以逗号分割的字符串,转化为list @Value("#{'${huobi.actualAdjustSymbols:,}'.split(',')}") private List<String> actualAdjustSymbols; 2.appollo配置转化为map msg- 阅读全文
posted @ 2022-08-11 17:29 北方寒士 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 给定一个原串和目标串,能对源串进行如下操作:1.在给定位置插入一个字符2.替换任意字符3.删除任意字符 要求完成一下函数,返回最少的操作数,使得源串进行这些操作后等于目标串。源串和目标串长度都小于2000。 阅读全文
posted @ 2022-03-13 18:55 北方寒士 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 给出一个有序数组,请在数组中找出目标值的起始位置和结束位置 你的算法的时间复杂度应该在O(log n)之内 如果数组中不存在目标,返回[-1, -1]. 例如: 给出的数组是[50, 70, 70, 80, 80, 100],目标值是80, 返回[3, 4]. /**** 两次二分查找**/ pub 阅读全文
posted @ 2022-03-13 18:50 北方寒士 阅读(194) 评论(0) 推荐(0) 编辑
摘要: class Solution { public boolean validPalindrome(String s) { char ch[] = s.toCharArray(); int l = 0, r = ch.length - 1; while(l < r) { if(ch[l] == ch[r 阅读全文
posted @ 2022-03-06 17:33 北方寒士 阅读(43) 评论(0) 推荐(0) 编辑
摘要: public ListNode reverseList(ListNode head) { if(head==null || head.next ==null){ return head; } ListNode cur = head.next; head.next = null; while(cur! 阅读全文
posted @ 2022-03-06 13:47 北方寒士 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。 public boolean isPalindrome(String s) { int n = s.length(); int left = 0, right = n - 1; while (left < right) 阅读全文
posted @ 2022-03-06 13:20 北方寒士 阅读(14) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-03-06 12:42 北方寒士 阅读(1) 评论(0) 推荐(0) 编辑
摘要: public ListNode rotateRight(ListNode head, int k) { if(head==null||head.next==null||k==0){ return head; } ListNode slow = head; ListNode fast = head; 阅读全文
posted @ 2022-03-05 21:00 北方寒士 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 给定一个整数数组 nums ,找到一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 示例: 输入: [-2,1,-3,4,-1,2,1,-5,4], 输出: 6 解释: 连续子数组 [4,-1,2,1] 的和最大,为 6。(只求最大子序和,不是最大子序区间) 思路 假设 nums 阅读全文
posted @ 2022-03-05 20:20 北方寒士 阅读(34) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 40 下一页