Saturday, October 3, 2015

Palantir interview question #1

--------------------------------------------------------------------
ref https://shawnlincoding.wordpress.com/2015/03/16/palantir%E9%9D%A2%E7%BB%8F/
1,
1. 给你一个棋盘 int[][] board, 你可以交换任何一个棋子和它的邻居(横向或者竖向相邻的棋子),如果交换后,在横向或者竖向产生了大于等于三个连续的一样的棋子 e.g. 4 4 4
5
5
5
那么就算交换有效。(就是一个比较常见的游戏,忘记叫啥名字了)
请你写一个函数返回所有可以有效交换的棋子的坐标对。 比如 ((0, 0), (1, 0)) , ((3,2),(3,3)).

2,看code,debug, 然后写出正确的code,这个没啥说的

3 Merge interval
Running Median : follow up: O(1) space


--------------------------------------------------------------------------------------

write a fuction to titlecase a string
for example
input: the quick brown fox
output: The Quick Brown Fox
two pointers, remember to update flag


DFS,很像coursera普林算法课讲得CC, 看看所以0是不是在一个CC里面
从0,0开始做一次DFS,如果有0没被marked到那就是invalid的



No comments:

Post a Comment