原创 【LeetCode】Excel Sheet Column Title(Excel表列名稱)

這道題是LeetCode裏的第168道題。 題目描述: 給定一個正整數,返回它在 Excel 表中相對應的列名稱。 例如, 1 -> A 2 -> B 3 -> C ... 26 -> Z

原创 【Codewars】All Inclusive?

Codewars裏的 7kyu Kata。 題目說明: Description: Input: a string strng an array of strings arr Output of function contain_all_

原创 【Codewars】Dubstep

Codewars裏的 6kyu Kata。 題目說明: Description: Polycarpus works as a DJ in the best Berland nightclub, and he often uses dub

原创 【Codewars】Integers: Recreation One

Codewars裏的 5kyu Kata。 題目說明: Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared are: 1, 4, 9, 36, 4

原创 【Codewars】Find The Parity Outlier

Codewars裏的 6kyu Kata。 題目說明: You are given an array (which will have a length of at least 3, but could be very large) c

原创 【Codewars】Bouncing Balls

Codewars裏的 6kyu Kata。 題目說明: A child is playing with a ball on the nth floor of a tall building. The height of this flo

原创 【LeetCode】Factorial Trailing Zeroes(階乘後的零)

這道題是LeetCode裏的第172道題。 題目描述: 給定一個整數 n,返回 n! 結果尾數中零的數量。 示例 1: 輸入: 3 輸出: 0 解釋: 3! = 6, 尾數中沒有零。 示例 2: 輸入: 5 輸出: 1 解釋: 5!

原创 【LeetCode】House Robber II(打家劫舍 II)

這道題是LeetCode裏的第213道題。 題目描述: 你是一個專業的小偷,計劃偷竊沿街的房屋,每間房內都藏有一定的現金。這個地方所有的房屋都圍成一圈,這意味着第一個房屋和最後一個房屋是緊挨着的。同時,相鄰的房屋裝有相互連通的防盜系統,

原创 【LeetCode】Reverse Bits(顛倒二進制位)

這道題是LeetCode裏的第190道題。 題目描述: 顛倒給定的 32 位無符號整數的二進制位。   示例 1: 輸入: 00000010100101000001111010011100 輸出: 001110010111100000

原创 【Codewars】Folding your way to the moon

Codewars裏的 7kyu Kata。 題目說明: Have you heard about the myth that if you fold a paper enough times, you can reach the moo

原创 【Codewars】Pick peaks

Codewars裏的 5kyu Kata。 題目說明: In this kata, you will write a function that returns the positions and the values of the "

原创 【Codewars】Data Reverse

Codewars裏的 6kyu Kata。 題目說明: Description: A stream of data is received and needs to be reversed. Each segment is 8 bits

原创 【LeetCode】Pascal's Triangle II(楊輝三角 II)

這道題是LeetCode裏的第119道題。 題目描述: 給定一個非負索引 k,其中 k ≤ 33,返回楊輝三角的第 k 行。 在楊輝三角中,每個數是它左上方和右上方的數的和。 示例: 輸入: 3 輸出: [1,3,3,1] 進階:

原创 【Codewars】Build a pile of Cubes

Codewars裏的 6kyu Kata。 題目說明: Your task is to construct a building which will be a pile of n cubes. The cube at the bott

原创 【Codewars】Multiply

Codewars裏的註冊題。沒有完成這道題就不能註冊賬號。 題目說明: The code does not execute properly. Try to figure out why. 解題方法:  public class M