原创 LeetCode:384. Shuffle an Array

Discuss Pick One <!-- @END Action Button--> <div class="question-description"> <

原创 去哪兒2017編程題

問題:對於每個測試實例,要求輸出大於n的下一個對稱數字。 分析:最小的對稱數字必然是改變靠近對稱軸的數字,因此對於輸入的數字可以分成以下2種: 1)對稱軸左邊的數字大於對應位置的右邊數字,此時直接將對稱軸左邊的數字對稱到右邊即可:

原创 LeetCode:526. Beautiful Arrangement

Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N

原创 LeetCode: 672. Bulb Switcher II

There is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m u

原创 秋招階段性總結(感悟)(2017-9-21)

互聯網公司的招聘從3、4月份的實習招聘開始,到6、7月份的內推,再到9、10月份的秋招,真是從悠悠閒閒,到有些着急,再到匆匆忙忙火急火燎,不堪回首。。。。 實習招聘:我們組導師的慣例是不讓出去實習,所以我一開始就沒有找實習,但是在5月份

原创 網易2018校招編程題

一個合法的括號匹配序列被定義爲: 1. 空串”“是合法的括號序列 2. 如果”X”和”Y”是合法的序列,那麼”XY”也是一個合法的括號序列 3. 如果”X”是一個合法的序列,那麼”(X)”也是一個合法的括號序列 4. 每個合法的括號序列

原创 LeetCode: 22. Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example

原创 LeetCode:553. Optimal Division

Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 /

原创 LeetCode: 498. Diagonal Traverse

Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in

原创 LeetCode:445. Add Two Numbers II

You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes firs

原创 LeetCode 382. Linked List Random Node

題目描述: LeetCode 382. Linked List Random Node Given a singly linked list, return a random node’s value from the linked

原创 LeetCode:539. Minimum Time Difference

Given a list of 24-hour clock time points in “Hour:Minutes” format, find the minimum minutes difference between any tw

原创 LeetCode: 421. Maximum XOR of Two Numbers in an Array

Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, wh

原创 LeetCode:529. Minesweeper

Let’s play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board.

原创 LeetCode:647. Palindromic Substrings

Given a string, your task is to count how many palindromic substrings in this string. The substrings with different