原创 面經------單向鏈表反轉
面經------單向鏈表反轉 問題描述 現定義瞭如下的ListNode結構, 要求對整個List進行反轉。 //Definition for singly-linked list. public class ListNode {
原创 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 st
原创 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 numbe
原创 面經------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
原创 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 w
原创 面經------Google Onsite(2)
又是純數學題. Black Jack. 給你infinity張牌. Card value 1到10. Find the probability that a card will bust. P(bust|x=hand) 玩家17
原创 面經------Google Onsite(1)
1.給定一棵二叉樹,在這棵樹中有一些節點需要被刪除,現在有一個可供調用的函數shouldBeErased(Node t)可以用來判斷每個節點是否應被移除(返回一個布爾值true或者false)。在刪除了那些需要被移除的節點之後,原來的
原创 Java8------Sort()
前言 Java 8中的排序算法功能極其強大,無論在寫法上還是可讀性上都完全超越前代sort。總的來說Java 8中的sort()有兩種,第一種替代了老版的sort,用lambda語句優化;第二種用在stream中,可以參照我後面的文章
原创 博弈論(Game Theory)------經典問題詳解(1)
Nash Equilibria(納什均衡) Definition A strategy profile x∗∈Sx^*∈ Sx∗∈S is a Nash equilibrium (NE) if no unilateral deviat
原创 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 dire
原创 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 give
原创 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, e
原创 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 clea
原创 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 hi
原创 LeetCode[Hard]------Sliding Window類型題目詳解
什麼是Sliding Window算法? 滑動窗口(Sliding Window)問題經常使用左邊界(left)和右邊界(right)來解決問題,[0, left) 的區域爲滑動窗口已經探索過的區域, [left, right]的區域