LeetCode
……
Sun_Sherry
这个作者很懒,什么都没留下…
展开
-
LeetCode 172. Factorial Trailing Zeroes
Description: Given an integern, return the number of trailing zeroes inn!. Example 1: Input: 3 Output: 0 Explanation:3! = 6, no trailing zero. 提交的代码如下: class Solution(object): def traili...原创 2019-06-25 10:18:12 · 118 阅读 · 0 评论 -
LeetCode 11. Container With Most Water
题目:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of lineiis at (i,ai) and (i, 0). Find t...原创 2019-02-21 20:14:50 · 113 阅读 · 0 评论 -
LeetCode 24: Swap Nodes in Pairs(交换链表中的两个节点)
题目:Given alinked list, swap every two adjacent nodes and return its head. You maynotmodify the values in the list's nodes, only nodes itself may be changed. (大意:相邻位置的两个节点进行值交换,但是要求以节点为单位进行交换。) 先上代...原创 2019-02-20 22:53:25 · 230 阅读 · 0 评论 -
LeetCode 31. Next Permutation
题目:Implementnext permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible...原创 2019-02-27 19:55:32 · 182 阅读 · 0 评论 -
LeetCode 34. Find First and Last Position of Element in Sorted Array
题目:Given an array of integersnumssorted in ascending order, find the starting and ending position of a giventargetvalue. Your algorithm's runtime complexity must be in the order ofO(logn). If th...原创 2019-03-12 19:14:21 · 138 阅读 · 0 评论