原创 [hihoCoder 1149] 迴文字符序列

描述 給定字符串,求它的迴文子序列個數。迴文子序列反轉字符順序後仍然與原序列相同。例如字符串aba中,迴文子序列爲"a", "a", "aa", "b", "aba",共5個。內容相同位置不同的子序列算不同的子序列。 輸入 第一

原创 [Google電面] String decompression

Problem Description     input              output 2[abc]3[a]c => abcabcabcaaac;     2[ab3[d]]2[cc] => abdddabdddcccc

原创 [2016 indeed筆試題] Tables and Pieces

Question There is a 6×6 table. Place a number of pieces on the table to me

原创 [Hihocoder 1289] 403 Forbidden (微軟2016校園招聘4月在線筆試)

Little Hi runs a web server. Sometimes he has to deny access from a certain set of malicious IP addresses while his

原创 [2016 微軟預科生計劃-探星夏令營在線測試2] Give My Text Back(字符串處理)

描述 To prepare for the English exam Little Ho collected many digital reading materials. Unfortunately the materials

原创 [Leetcode]358. Rearrange String k Distance Apart (貪心,窗口,堆,字符)

 Given a non-empty string str and an integer k, rearrange the string such that the same characters are at least distanc

原创 [hihoCoder 太閣最新面經算法競賽6] 數組重排(N個數的最小公倍數)

描述 小Hi想知道,如果他每次都按照一種固定的順序重排數組,那麼最少經過幾次重排之後數組會恢復初始的順序? 具體來講,給定一個1 - N 的排列 P,小Hi每次重排都是把第 i 個元素放到第 Pi個位置上。例如對於 P = (2

原创 [hihoCoder太閣最新面經算法競賽9] 題目一:Browser Caching (LRU緩存)

時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 When you browse the Internet, browser usually caches some documents to red

原创 [Google APAC 2017] Lazy Spelling Bee

Problem In the Lazy Spelling Bee, a contestant is given a target word W to spell. The contestant's answer word A is acc

原创 [Google Round A APAC 2017] Problem B. Rain

Problem There's an island in the sea. The island can be described as a matrix with R rows and Ccolumns, with H[i][j] in

原创 Google 面試題

題目一  :題目就是給你一個matrix,裏面的數字代表bar的高度,現在說降雨量如果高於bar的高度水可以漫過去,降雨量0開始每天+1這樣,問最早第幾天水可以有一條路徑從src漫到dst。即 起點到終點的所有路徑中,求路徑最大點的最小值

原创 [Google 2017 Apac] Robot Rock Band

Problem You're the manager of Xorbitant, the world's first robot rock band. There will be four positions in the band, a

原创 [Practice Round APAC test 2016]Problem A. Bad Horse(Google 2016筆試題)

Problem As the leader of the Evil League of Evil, Bad Horse has a lot of problems to deal with. Most recently, there ha

原创 [hihoCoder太閣最新面經算法競賽1] 穿越禁區 (DFS,並查集,計算幾何) 難題

描述 作爲H國的精英特工,你接到了一項任務,駕駛一輛吉普穿越佈滿監測雷達的禁區。爲了簡化題目,我們可以把禁區想象爲一個左下角是(0, 0)右上角是( W, H )的長方形區域。區域中一共有 N 座雷達,其中第 i 座的座標是(Xi

原创 [Hihocoder]1335 : Email Merge (並查集)

描述 You are given a list of usernames and their email addresses in the following format: alice 2 [email protected]