[LeetCode] 202. Happy Number Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of 2019-10-14 #leetcode #hashmap #java #javascript #math
[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] 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 #selection sort #LIS
[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