标签: leetcode

记录点滴,修炼自己。
0

leetcode [#92]

题目 Reverse a linked list from position m to n. Do it in-place and in one-pass. Example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL. Example:Giv

0

leetcode [#9]

题目 Determine whether an integer is a palindrome. Do this without extra space. Some hints:Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note

0

leetcode [#88]

题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additi

0

leetcode [#86]

题目 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each o

0

leetcode [#82]

题目 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example:Given 1->2->3->3->4->4->5, return 1->2-

0

leetcode [#83]

题目 Given a sorted linked list, delete all duplicates such that each element appear only once. Example:Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3. 解决方案

0

leetcode [#8]

题目 Implement atoi to convert a string to an integer. HintCarefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cas

0

leetcode [#75]

题目 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers

0

leetcode [#7]

题目 Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 解决方案1234567891011public class Solution { public int reverse(int x) { String s = Str

0

leetcode [#67]

题目 Given two binary strings, return their sum (also a binary string). Examplea = “11”b = “1”Return “100”. 解决方案123456789101112131415161718192021222324252627282930313233343536373839404142434445464748

0

leetcode [#66]

题目 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 解决方案1234567891011121

0

leetcode [#62]

题目 A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the

0

leetcode [#58]

题目 Given a string s consists of upper/lower-case alphabets and empty space characters ‘ ‘, return the length of last word in the string. If the last word does not exist, return 0. ExampleGiven s = “H

0

leetcode [#53]

题目 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. Examplegiven the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-1,2,1] has the l

0

leetcode [#6]

题目 The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) 123P A H NA P L S

0

leetcode [#463]

题目 You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is complet

0

leetcode [#448]

题目 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this array.Coul

0

leetcode [#438]

题目 Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s.Strings consists of lowercase English letters only and the length of both strings s and p will not be lar

0

leetcode [#415]

题目 Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of th

0

leetcode [#409]

题目 Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example “Aa” is not con