LeetCode

The solution of problem in LeetCode

LeetCode Digest - Move Zeroes

283. Move Zeroes Problem Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, given nums

LeetCode Digest - BrainTeaser Series

292. Nim Game Problem You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1

LeetCode Digest - Reverse String Series

344. Reverse String Problem: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". Solution 1 Using list comprehension:

LeetCode Digest - Valid Number

65. Valid Number Problem: Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a"

LeetCode Digest - Reverse Integer

7. Reverse Integer Problem: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here are some good questions to ask before coding.