Leetcode - Reverse Vowels of a String Solution
Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Example 2: Note: The vowels does not include the letter "y". Solution in python
Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Example 2: Note: The vowels does not include the letter "y". Solution in python
You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the ith customer has in the jth bank. Return the wealth that the richest customer has. A customer's…
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Example 2: Example 3: Constraints: 1 <= nums.length <= 1000 -10^6 <= nums[i]…
Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has. For each kid check if there is a way to distribute extraCandies among the kids such that he…
In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. Return the element repeated N times. Example 1: Example 2: Example 3: Note: 4 <= A.length <= 10000 0 <= A[i]…
Given a string s and an integer array indices of the same length. The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string. Return the shuffled string. Example…
Given an array of integers nums. A pair (i,j) is called good if nums[i] == nums[j] and i < j. Return the number of good pairs. Example 1: Example 2: Example 3: Constraints: 1 <= nums.length <= 100 1 <= nums[i] <= 100…
Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Example 2: Constraints: 1 <= nums.length <= 500 1 <= nums[i] <= 10^5 Solution in Python
Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not. Example 1: Example 2: Example 3…
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…
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same…