- 博客(16)
- 资源 (1)
- 收藏
- 关注
原创 LeetCode[Medium]------947. Most Stones Removed with Same Row or Column
问题描述On a 2D plane, we place stones at some integer coordinate points. Each coordinate point may have at most one stone.Now, a move consists of removing a stone that shares a column or row with anot...
2018-12-30 06:54:37
388
原创 面经------Google Onsite(3)
Onsite (4 rounds):n-straight, see if a list is a valid n-straight list,e.g. 3-straight: [1, 2, 3] return True, [1,2,4] return false, [1,2,3,4] return false, [1,2,3,4,5,6] return true, cause it can...
2018-11-20 09:57:39
510
1
原创 LeetCode[Hard]------837. New 21 Game
问题描述Alice plays the following game, loosely based on the card game “21”.Alice starts with 0 points, and draws numbers while she has less than K points. During each draw, she gains an integer number...
2018-11-15 12:09:02
279
原创 面经------Google Onsite(2)
又是纯数学题. Black Jack.给你infinity张牌. Card value 1到10. Find the probability that a card will bust. P(bust|x=hand)玩家17 to 21时赢, 超过21 bust.给你N幅画. 每幅画都有price和quality. 用最低价格买K幅画, with 0<K<=NConst...
2018-11-12 08:48:50
786
原创 面经------Google Onsite(1)
1.给定一棵二叉树,在这棵树中有一些节点需要被删除,现在有一个可供调用的函数shouldBeErased(Node t)可以用来判断每个节点是否应被移除(返回一个布尔值true或者false)。在删除了那些需要被移除的节点之后,原来的二叉树就会被打散成一棵棵子树,或者说是一个森林,要求返回最终的这个森林(用一个数组来表示,数组中每个元素是对应子树的树根)。我就说可以用DFS,从树根开始搜索,对每...
2018-11-11 08:28:48
795
原创 LeetCode[Hard]------642. Design Search Autocomplete System
问题描述Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character ‘#’). For each character they type except ‘#’, you need to ...
2018-11-11 07:42:06
501
原创 Java8------Sort()
前言Java 8中的排序算法功能极其强大,无论在写法上还是可读性上都完全超越前代sort。总的来说Java 8中的sort()有两种,第一种替代了老版的sort,用lambda语句优化;第二种用在stream中,可以参照我后面的文章。如果你还在创建Comparator去排序,一定要看看我这篇blog。代码及分析首先我们来比较一下比较简单的sort。对于Array的sort:Arrays...
2018-11-08 10:07:31
8425
1
原创 LeetCode[Hard]------418. Sentence Screen Fitting
问题描述Given a rows x cols screen and a sentence represented by a list of non-empty words, find how many times the given sentence can be fitted on the screen.Note:A word cannot be split into two line...
2018-11-07 09:59:51
382
原创 LeetCode[Hard]------803. Bricks Falling When Hit
问题描述We have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only if it is directly connected to the top of the grid, or at least one of its (4-way) adjacent bric...
2018-11-06 05:55:56
336
原创 博弈论(Game Theory)------经典问题详解(1)
Nash Equilibria(纳什均衡)DefinitionA strategy profile x∗∈Sx^*∈ Sx∗∈S is a Nash equilibrium (NE) if no unilateral deviation in strategy by any single player is profitable for that player, that is∀i,xi∈S...
2018-11-05 10:18:59
4450
原创 LeetCode[Hard]------489. Robot Room Cleaner
问题描述Given a robot cleaner in a room modeled as a grid.Each cell in the grid can be empty or blocked.The robot cleaner with 4 given APIs can move forward, turn left or turn right. Each turn it made ...
2018-11-05 08:36:15
1608
1
原创 LeetCode[Hard]------843. Guess the Word
问题描述This problem is an interactive problem new to the LeetCode platform.We are given a word list of unique words, each word is 6 letters long, and one word in this list is chosen as secret.You may ...
2018-11-04 08:16:48
816
原创 LeetCode[Hard]------857. Minimum Cost To Hire K Workers
LeetCode[Hard]------857. Minimum Cost To Hire K Workers问题描述There are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i].Now we want to hire exactly K workers to for...
2018-11-03 09:58:04
163
转载 面经------JVM详解
1、内存模型堆:Java虚拟机管理内存中最大的一块,线程共享区域。所有对象实例和数组都在堆上分配内存空间。栈:在Hotspot中虚拟机栈和本地方法栈是在一起的。它是线程私有,每个线程都会创建一个虚拟机栈,生命周期与线程相同。每个方法被执行的时候就会创建一个栈帧,用于存储局部变量表,操作数栈,动态链接,方法出口等信息。一个方法执行的过程对应着一个栈帧的入栈到出栈过程。方法区:用于存储类信息,...
2018-11-02 08:34:17
402
1
原创 LeetCode[Hard]------Sliding Window类型题目详解
LeetCode[Hard]------Sliding Window类型题目详解什么是Sliding Window算法?滑动窗口(Sliding Window)问题经常使用左边界(left)和右边界(right)来解决问题,[0, left) 的区域为滑动窗口已经探索过的区域, [left, right]的区域为滑动窗口正在探索的区域, (right, length-1)为待探索的区域。Sl...
2018-11-02 07:52:12
587
原创 面经------单向链表反转
面经------单向链表反转问题描述现定义了如下的ListNode结构, 要求对整个List进行反转。//Definition for singly-linked list.public class ListNode { int val; ListNode next; ListNode(int x) { val = x; }}递归解法递归的思路是...
2018-11-01 09:12:56
184
Advanced Analytics with Spark 2nd Edition
2018-11-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人