Given a matrix of m x n elements (m rows, n columns), return all elements o…
分类:LeetCode
2018-05-14 172. Factorial Trailing Zeroes
题意:给你一个数n,输出n的阶乘n!尾端0的个数。 解题思路:阶乘结果末端的0是由5 * 2、5 * 4、5 * 偶数和10、20、30… 100、200…1000等末尾含0的乘数构成。 其实10…
LeetCode[15] - Flip Game II
这个题目李特是屌炸天的。 我飞了九牛二虎之力(路子对),但是代码写的七荤八素,好长好长好长好长的。 结果正解,三四行就搞定了。真是心有不甘啊。 想法如下: 保证p1能胜利,就必须保持所有p2的move都不能赢。 同时,p…
[LeetCode By Go 80]21. Merge Two Sorted Lists
题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together…
54. Spiral Matrix
54. Spiral Matrix 题目 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix i…
[LeetCode] String to Integer (atoi) 字符串转为整数
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible …
[LeetCode] Additive Number 加法数
Additive number is a positive integer whose digits can form additive sequence. A valid additive sequenc…
[LeetCode] First Unique Character in a String 字符串第一个不同字符
Given a string, find the first non-repeating character in it and return it’s index. If it doesn…
322. Coin Change
You are given coins of different denominations and a total amount of money amount. Write a function to compute…
[Leetcode] Excel Sheet Column Title Number Conversion Excel列值转换
Excel Sheet Column Number Related to question Excel Sheet Column Title Given a column title as appear in an Ex…
【LeetCode】- Reverse Nodes in k-Group
1、题目描述 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is …
566. Reshape the Matrix
描述 In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix into a …