原创 Palindrome Linked List - JS
Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?
原创 First Bad Version - Javascript
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of
原创 Remove Linked List Elements - JS
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 -->
原创 Rotate Array - Javacript
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] i
原创 Reverse Integer - Javacript
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Tag Math ----------------
原创 Valid Sudoku - Javacript
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled,
原创 Count Primes - Javascript
Description: Count the number of prime numbers less than a non-negative number, n. Credits: Special thanks to @mithm
原创 Longest Common Prefix - Javacript
Write a function to find the longest common prefix string amongst an array of strings. Tags String ----------------
原创 Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may ass
原创 Factorial Trailing Zeroes - Javacript
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time com
原创 Minimum Depth of Binary Tree - Javascript
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from th
原创 Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A
原创 Compare Version Numbers
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1,
原创 Add Binary - Javacript
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". Tag Ma
原创 ZigZag Conversion - Javascript
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to disp