
leetcode
leetcode刷题小记
蝉沐风的码场
这个作者很懒,什么都没留下…
展开
-
5. Longest Palindromic Substring
package com.chanmufeng.leetcode; /** * faster than 61.63% * 最后求取子串的处理不是很地道 */ public class LongestPalindromicSubString_5 { private static char[] manacherString(String str) { char[] str...原创 2018-11-24 18:09:44 · 143 阅读 · 0 评论 -
218. The Skyline Problem
package com.chanmufeng.questions; import java.util.*; public class Skyline { public static class Node { public int pos; public int height; public boolean isUp; pu...原创 2018-11-24 16:04:57 · 138 阅读 · 0 评论 -
75. Sort Colors
方法1:快速排序的partition思想 class Solution { public void sortColors(int[] nums) { int l = 0; int r = nums.length-1; int cur = l; while (cur <= r){ if (nums[...原创 2018-11-16 11:57:34 · 184 阅读 · 0 评论 -
402. Remove K Digits
faster than 88.79% of Java online submissions for Remove K Digits. public class Solution { public String removeKdigits(String num, int k) { int newLength = num.length() - k; char...原创 2018-11-13 07:45:50 · 276 阅读 · 0 评论