水下功夫做透,水上才能顺风顺水。
摘要: 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) 编辑