## Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!. Note that n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1. https://leetcode.com/problems/factorial-trailing-zeroes/ Solution Count How many 5 in the n Code python class Solution: def trailingZeroes(self, n: int) -> int: ret = 0 while n >= 5: n //= 5 ret += n return ret

## Missing Number

Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. https://leetcode.com/problems/missing-number/ code python class Solution: def missingNumber(self, nums: List[int]) -> int: # 应该的总和 - 实际的总和 return (len(nums) * (len(nums) + 1)) // 2 - sum(nums) # 利用......

## Coin Change | Dynamic Programming

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. You may assume that you have an infinite number of each kind of coin. https://leetco......

## Fibonacci Number | DpTable | Violent Hacking

The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. https://leetcode.com/problems/fibonacci-number/ Solution Violent Hacking / DP Table Code Violent Hacking O(2^n) submit code class Solution: def fib(self, n: int) -> int: ......

## Move Zeroes

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. https://leetcode.com/problems/move-zeroes/ Solution Double Pointer / Fast And Slow Pointer Same with https://www.emperinter.info/2022/03/15/remove-duplicates-from-sorted-list/ we need......

## Remove Element

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the fir......

## Remove Duplicates from Sorted List

Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. https://leetcode.com/problems/remove-duplicates-from-sorted-list/ Solution Double Pointer / Fast And Slow Pointer The Solution is Same With Remove Duplicates from Sorted Array Code submit code # Definit......

## Remove Duplicates from Sorted Array

Description Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array n......

## 优惠码

 阿里云国际版 20美元 Vultr 10美元 搬瓦工 | Bandwagon 应该有折扣吧？ Just My Socks JMS9272283 【注意手动复制去跳转】 域名 | namesilo `emperinter`(1美元)