10 2022 档案
摘要:找到最长的回文序列 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad"
阅读全文
摘要:Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity shou
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng
阅读全文
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai
阅读全文
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex
阅读全文
摘要:见leetcode43 Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: The length of both num1 a
阅读全文
摘要:1、归并排序 归并是把两个或两个以上有序表合并成一个新的有序表,即把待排序序列分为若干个子序列,每个子序列是有序的,然后把有序子序列合并为整体有序序列。 注意:在递归中必须传入(low, middle)和(middle+1, high),而快排的递归中可以是(low, middle - 1)和(mi
阅读全文
摘要:public static int printN(int n) { int var = 1; while (n > 0) { var++; if (isPrime(var)) { n--; if (n == 0) { return var; } } } return var;}public stat
阅读全文
摘要:public static void sortStack(Stack stack){ int temp; Stack stack2 = new Stack<>(); while(!stack.isEmpty()) { temp = stack.pop(); if (stack2.isEmpty())
阅读全文