LeetCode Solution - Problem Reverse String

  • Write a function that reverses a string. The input string is given as an array of characters s.
  • You must do this by modifying the input array in-place with O(1) extra memory.
Example 1:

Input: s = ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]

LeetCode Solution - Problem Pow(x, n)

  • Implement pow(x, n), which calculates x raised to the power n (i.e., x^n).
Example 1:

Input: x = 2.00000, n = 10
Output: 1024.00000

LeetCode Solution - Problem 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.
Example 1:

Input: n = 3
Output: 0
Explanation: 3! = 6, no trailing zero.

LeetCode Solution - Problem Palindrome Number

  • Given an integer x, return true if x is a palindrome, and false otherwise. 
Example 1:

Input: x = 121
Output: true
Explanation: 121 reads as 121 from left to right and from right to left.

LeetCode Solution - Problem Reverse Integer

  • Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.
  • Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
Example 1:

Input: x = 123
Output: 321

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...