摘要:
here are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take th 阅读全文
摘要:
Given two variables, x and y, swap two variables without using a third variable. Given two variables, x and y, swap two variables without using a thir 阅读全文
摘要:
Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Have you met this question in a real 阅读全文
摘要:
Given two array of integers(the first array is array A, the second array is array B), now we are going to find a element in array A which is A[i], and 阅读全文
摘要:
Given a binary tree, return the preorder traversal of its nodes' values. Example Given: 1 / \ 2 3 / \ 4 5 return [1,2,4,5,3]. without using recursion. 阅读全文
摘要:
Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
摘要:
Find the second max number in a given array. Example Given [1, 3, 2, 4], return 3. Given [1, 2], return 1. Notice : Attention corner case. Communicate 阅读全文
摘要:
Given n nodes in a graph labeled from 1 to n. There is no edges in the graph at beginning. You need to support the following method:1. connect(a, b), 阅读全文
摘要:
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
摘要:
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac 阅读全文