自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 问答 (1)
  • 收藏
  • 关注

原创 LeetCode刷题day019 (Jieky)

LeetCode第19题/*Remove Nth Node From End of List #题目 #Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the

2020-12-29 23:05:56 111

原创 LeetCode刷题day018 (Jieky)

LeetCode第18题/*Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:The solution set must not co

2020-12-28 23:41:45 97

原创 LeetCode刷题day017 (Jieky)

LeetCode第17题/*Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to an

2020-12-27 21:56:26 218 2

原创 LeetCode刷题day016 (Jieky)

LeetCode第16题/*Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.Example:Giv

2020-12-24 23:56:48 117

原创 LeetCode刷题day015 (Jieky)

LeetCode第15题/*Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not contain duplicate triplets.Example:Given a

2020-12-23 23:47:25 138 1

原创 LeetCode刷题day014 (Jieky)

LeetCode第13题/*Roman numerals are represented by seven different symbols: I(1), V(5), X(10), L(50), C(100), D(500) and M(1000).For example, two is written as II in Roman numeral, just two one's added together. Twelve is writen as, XII , which is simply

2020-12-22 21:32:55 109 1

原创 LeetCode刷题day013 (Jieky)

LeetCode第14题/*Write a function to find the longest common prefix string amongst an array of strings If there is no common prefix, return an empty string ""Example 1: Input: ["flower","flow","flight"]Output: "f1"Example 2: Input: ["dog", "racecar"

2020-12-21 23:28:45 157 1

原创 LeetCode刷题day012 (Jieky)

LeetCode第12题/*Roman numerals are represented by seven different symbols: I(1), V(5), X(10), L(50), C(100), D(500) and M(1000).For example, two is written as II in Roman numeral, just two one's added together. Twelve is written as, XII which is simply X

2020-12-20 22:12:45 214 4

原创 LeetCode刷题day011 (Jieky)

LeetCode第11题/*Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a

2020-12-19 20:11:18 210 1

原创 LeetCode刷题day010 (Jieky)

LeetCode第9题/*Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanation: From left to right, it reads -121. Fr

2020-12-18 22:25:49 127 1

原创 LeetCode刷题day009 (Jieky)

LeetCode第8题/*Given an input string (s) and a pattern (p). implement regular expression matching with support for '.' and '*'. '.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire inp

2020-12-17 23:48:58 105

原创 LeetCode刷题day008 (Jieky)

LeetCode第8题/*Implement atoi which converts a string to an integer The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial pl

2020-12-16 23:39:50 101

原创 LeetCode刷题day007 (Jieky)

LeetCode第7题/*Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note: Assume we are dealing with an environment which could only store in

2020-12-15 23:18:17 118

原创 LeetCode刷题day006 (Jieky)

LeetCode第6题/*将一个给定字符串根据给定的行数,以从上往下、从左到右进行 Z 字形排列。比如输入字符串为 "LEETCODEISHIRING" 行数为 3 时,排列如下:L C I RE T O E S I I GE D H N之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:"LCIRETOESIIGEDHN"。请你实现这个将字符串进行指定行数变换的函数:string convert(string s, int numRows);

2020-12-14 22:41:18 116

原创 LeetCode刷题day005 (Jieky)

上一篇博客问题解/*最长上升子序列(LIS)问题:给定长度为n的序列a,从a中抽取出一个子序列,这个子序列需要单调递增。问最长的上升子序列(LIS)的长度。  e.g. 1,5,3,4,6,9,7,8的LIS为1,3,4,6,7,8,长度为6。*/import java.util.Arrays;public class Test02 { public static void main(String[] args){ // 最坏情况,数列是降序的,最长升序子序列长度为1

2020-12-13 23:56:09 165

原创 LeetCode刷题day004 (Jieky)

动态规划讲解动态规划例题1/** 先来看看生活中经常遇到的事吧——假设您是个土豪,身上带了足够的1、5、11元面值的钞票。现在您的目标是凑出某个金额w=15,需要用到尽量少的钞票。* */public class Test { public static void main(String[] args){ int[] f = new int[105]; int n=15,cost=0; // i为0,则用0张钞票 f[0]

2020-12-12 23:44:10 127

原创 LeetCode刷题day003 (Jieky)

LeetCode第4题/*There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and nums2 cannot be both empty.Example 1:nums

2020-12-12 00:03:48 112 3

原创 LeetCode刷题day002 (Jieky)

LeetCode第一题import java.util.HashSet;import java.util.Set;import java.util.Map;import java.util.HashMap;import java.lang.Math;public class LongestSubstringWithoutRepeatingCharacters{ // 暴力破解 public int getSubStringLength01(String s){ int ans = 0;

2020-12-10 21:08:50 109 2

原创 LeetCode刷题day001 (Jieky)

LeetCode第一题/*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 exactly one solution, and you may not use the same element twice.Example:Given nums = [2

2020-12-09 21:53:47 253 4

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除