Coding Interviews

Leetcode 409: Longest Palindrome | Leetcode Easy

Leetcode 409: Longest Palindrome | Leetcode Easy

Category: Easy Problem Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, “Aa” is not considered a palindrome here. Problem Link. Examples Example 1: Example 2: Constraints 1 <= s.length <= 2000 s consists of lowercase and/or uppercase English letters only. Solution Approach In this

Leetcode 409: Longest Palindrome | Leetcode Easy Read More »

Richest Customer Wealth

Leetcode 1672: Richest Customer Wealth

Category: Easy Problem You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the i​​​​​​​​​​​th​​​​ customer has in the j​​​​​​​​​​​th​​​​ bank. Return the wealth that the richest customer has. A customer’s wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth. Problem Link. Examples Example 1: Example 2: Constraints

Leetcode 1672: Richest Customer Wealth Read More »

Remove Element - Leetcode 27

Leetcode 27: Remove Element

Category: Easy Problem Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. The order of elements can be changed. It doesn’t matter what you leave beyond the new length. https://leetcode.com/problems/remove-element Examples Example

Leetcode 27: Remove Element Read More »