Data Structures & Algorithms
237 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- Jump Gamehistorical
Each element of a nonnegative integer array gives the maximum jump length from that position. Determine whether the last position is reachable.
- Maximum Product Subarrayhistorical
Given an integer array nums, find the contiguous subarray with the largest product (the subarray contains at least one number) and return that product.
- Check Palindromehistorical
Given a string, write a function to determine whether it is a palindrome. Return true if it is, otherwise return false.
- Maximum Subarrayhistorical
Given an integer array nums, find the contiguous subarray with the largest sum (the subarray contains at least one element) and return its sum.
- Reverse Stringhistorical
Write a program that accepts a string and outputs the reversed string. (The string length does not exceed 1000.).
- First Missing Positivehistorical
Given an unsorted integer array nums, find the smallest positive integer that does not appear in the array.
- Palindromic Substringshistorical
Given a string, calculate how many palindromic substrings it contains.
- 3Sumhistorical
Given an array nums containing n integers, determine whether there are three elements a, b, and c such that a + b + c = 0. Find all unique triplets whose sum is 0.
- Find the Duplicate Numberhistorical
Given n + 1 integers whose values range from 1 to n, find the repeated number.
- Longest Palindromic Substringhistorical
Given a string s, find the longest palindromic substring in s.