摘要:leetcode algorithms 26 Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in place such that each element appear onl
阅读全文
摘要:leetcode algorithms 27 Remove Element Given an array nums and a value val, remove all instances of that value in place and return the new length. Do n
阅读全文
摘要:leetcode algorithms 28 Implement strStr() mplement strStr(). Return the index of the first occurrence of needle in haystack, or 1 if needle is not par
阅读全文
摘要:leetcode algorithms 24 Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm shoul
阅读全文
摘要:leetcode algorithms 25 Reverse Nodes in k Group Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is
阅读全文
摘要:leetcode algorithms 23 Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example
阅读全文
摘要:leetcode algorithms 20 Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string
阅读全文
摘要:leetcode algorithms 21 Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing toget
阅读全文
摘要:leetcode algorithms 22 Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well formed parentheses. Fo
阅读全文
摘要:leetcode algorithms 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: N
阅读全文
摘要:leetcode algorithms 18 4Sum 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
阅读全文
摘要:leetcode algorithms 17 Letter Combinations of a Phone Number Given a string containing digits from 2 9 inclusive, return all possible letter combinati
阅读全文
摘要:leetcode algorithms 16 3Sum Closest Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest
阅读全文
摘要:leetcode algorithms 15 3Sum 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
阅读全文
摘要:leetcode algorithms 14 Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. If there is no com
阅读全文
摘要:leetcode algorithms 12 Integer to Roman Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written
阅读全文
摘要:leetcode algorithms 11 Container With Most Water Given n non negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai).
阅读全文
摘要:leetcode algorithms 10 Regular Expression Matching Given an input string (s) and a pattern (p), implement regular expression matching with support for
阅读全文
摘要:leetcode algorithms 8 String to Integer (atoi) Implement atoi which converts a string to an integer. The function first discards as many whitespace ch
阅读全文
摘要:leetcode algorithms 6 ZigZag Conversion The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want
阅读全文
摘要:leetcode algorithms 13 Roman to Integer Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written
阅读全文
摘要:leetcode algorithms 5 Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum len
阅读全文
摘要:leetcode algorithms 7 Reverse Integer Given a 32 bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note: Assume we ar
阅读全文
摘要:leetcode algorithms 9 Palindrome Number Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as fo
阅读全文
摘要:leetcode algorithms 4 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two
阅读全文
摘要:leetcode algorithms 3 Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating charac
阅读全文
摘要:leetcode algorithms 2 Add Two Numbers You are given two non empty linked lists representing two non negative integers. The digits are stored in revers
阅读全文
摘要:leetcode algorithms 1 two sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume
阅读全文