摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2017-06-12 06:21 Phoebe815 阅读(112) 评论(0) 推荐(0) 编辑
摘要: A magic index in an array A[0...n-1] is defined to be an index such that A[i] = i. Given a sorted array of distinct integers, write a method to find a 阅读全文
posted @ 2016-12-08 12:16 Phoebe815 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Imagine a robot sitting on the upper left corner of grid with r rows and c columns. The robot can only move in two directions, right and down, but cer 阅读全文
posted @ 2016-12-08 10:39 Phoebe815 阅读(361) 评论(0) 推荐(0) 编辑
摘要: A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3 steps at a time. Implement a method to count how many possible 阅读全文
posted @ 2016-12-08 06:32 Phoebe815 阅读(345) 评论(0) 推荐(0) 编辑
摘要: Uber总是考一些系统设计的题目,而且重复率很高,汇总了一下地里的所有design的题目,希望可以跟小伙伴们讨论下。Uber Design Questions1. 让design uber app2. 常见题-Design spotify,主要在问playlist和shuffle list功能。... 阅读全文
posted @ 2015-11-30 12:10 Phoebe815 阅读(640) 评论(0) 推荐(0) 编辑
摘要: http://www.geeksforgeeks.org/print-binary-tree-vertical-order/ 1 package algorithms; 2 3 import java.util.ArrayList; 4 import java.util.List; 5 impor... 阅读全文
posted @ 2015-11-30 06:54 Phoebe815 阅读(381) 评论(0) 推荐(0) 编辑
摘要: You are playing the followingBulls and Cowsgame with your friend: You write a 4-digit secret number and ask your friend to guess it. Each time your fr... 阅读全文
posted @ 2015-11-03 08:53 Phoebe815 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6... 阅读全文
posted @ 2015-11-03 06:56 Phoebe815 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and empty... 阅读全文
posted @ 2015-10-31 09:55 Phoebe815 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennums[i]andnums[j]is at mo... 阅读全文
posted @ 2015-10-31 04:26 Phoebe815 阅读(152) 评论(0) 推荐(0) 编辑