## 一个十分好的例子去写 Binary Search

Leetcode 278. First Bad Version You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of ... ...

## Useful LeetCode Library

Convert an integer into an array of digits: var getDigitsArray = function(num){ if(num === 0) return [0]; var arr = []; while(num > 0){ var digit = nu ... ...

## Tech Interview Exam Question: Delete Node in a BST (Hard Core!)

Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th ... ...

## Tech Interview Exam Question: Given a linked list, determine if it has a cycle in it.

Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi ... ...

## Javascript Tech Interview Question: Add 2 Big-Integer Strings

Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is < 5100 ... ...

## Tech Interview Exam Question: Linked List Random Node

Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen. Follow ... ...

## Tech Interview Exam Question: the “pivot” index of this array

Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot index as the index where ... ...