CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 8. String to Integer (atoi)

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. The algorithm for myAtoi(string s) is as follows: Whitespace: Ignore any leading whitespace (“ “).Signednes
2019-10-13
#leetcode #java #javascript #math #string

[LeetCode] 2. Add Two Numbers

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 contains a single digit. Add the two numbers and return
2019-10-13
#leetcode #java #javascript #linked list

[LeetCode] 20. Valid Parentheses

Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. An input string is valid if:Open brackets must be closed by the same type of br
2019-10-11

[LeetCode] 242. Valid Anagram

Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all
2019-10-10
#leetcode #array #java #javascript #counting sort

[LeetCode] 128. Longest Consecutive Sequence

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time. Example 1:Input: nums = [100,4,200,1,
2019-10-09
#leetcode #array #hashmap #java #javascript #LIS

[LeetCode] 334. Increasing Triplet Subsequence

Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false. Example
2019-10-09
#leetcode #array #java #javascript #LIS #selection sort

[LeetCode] 7. Reverse Integer

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment
2019-10-09
#leetcode #java #javascript #math

[LeetCode] 1. Two Sum

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have exactly one solution, and you may not
2019-10-08
#leetcode #array #two pointer #hashmap #java #javascript #two sum
1…454647

Search

Hexo Fluid