原创 Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such

原创 Implement strStr() - Javascript

Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of h

原创 Range Sum Query - Javacript

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given

原创 51. N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.

原创 212. Word Search II

Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed

原创 Binary Tree Paths - Javascript

Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2

原创 Permutations

Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following perm

原创 69. Sqrt(x)

題目原意: Implement int sqrt(int x). Compute and return the square root of x. 實現int sqrt(int x). 計算並返回x的平方根。 Solution 1

原创 Javascript Object, Set, Map總結

Dictionary Use objects as associated arrays.  定義:var object = {}; 常用方法:  check whether key is in object: object.hashOwn

原创 Isomorphic Strings - Javacript

Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be

原创 Subsets

Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicat

原创 Binary Tree Inorder Traversal - JS

Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,3],

原创 Bulls and Cows - JS

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to gu

原创 Remove Nth Node From End of List - JS

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list:

原创 Binary Tree Preorder -JS

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3},