thepracticaldev.com thepracticaldev.com

Solution: Maximum Gap

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #164 (Hard): Maximum Gap Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the...

thepracticaldev.com thepracticaldev.com

Solution: Maximum Erasure Value

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #1695 (Medium): Maximum Erasure Value Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) You are given an array of positive integers nums and want to erase a subarray containing unique elements....

thepracticaldev.com thepracticaldev.com

Solution: Minimum Moves to Equal Array Elements II

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #462 (Medium): Minimum Moves to Equal Array Elements II Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) Given an integer array nums of size n, return the minimum number of moves required to...

thepracticaldev.com thepracticaldev.com

Solution: Ambiguous Coordinates

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #816 (Medium): Ambiguous Coordinates Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed...

thepracticaldev.com thepracticaldev.com

Solution: Find First and Last Position of Element in Sorted Array

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #34 (Medium): Find First and Last Position of Element in Sorted Array Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) Given an array of integers nums sorted in ascending order, find the...

thepracticaldev.com thepracticaldev.com

Solution: Power of Three

This is part of a series of Leetcode solution explanations (index). If you liked this solution or found it useful, please like this post and/or upvote my solution post on Leetcode's forums. Leetcode Problem #326 (Easy): Power of Three Description: (Jump to: Solution Idea || Code: JavaScript | Python | Java | C++) Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of...