All Posts

Leetcode 1662: Check If Two String Arrays are Equivalent

You are given two string arrays word1 and word2. Return true if these two arrays represent the same string when their elements are concatenated in order, otherwise return false.

Leetcode 1664: Ways to Make a Fair Array

You are given an array nums of integers. You are allowed to remove one element from the array at any index. After removing the element, the remaining array is called ‘fair’ if the sum of the values at the odd indices is equal to the sum of the values at the even indices. The task is to find how many indices you can remove such that the resulting array is fair.

Leetcode 1670: Design Front Middle Back Queue

Design a queue that supports operations at the front, middle, and back. Implement the FrontMiddleBackQueue class with methods for adding and removing elements from these positions.

Leetcode 1672: Richest Customer Wealth

You are given a 2D list accounts, where each row represents a customer and each element within a row is the amount of money they have in a particular bank. Your task is to return the wealth of the richest customer. A customer’s wealth is the sum of all their bank accounts’ balances. The richest customer is the one with the maximum wealth.

Leetcode 1673: Find the Most Competitive Subsequence

Given an integer array nums and a positive integer k, return the most competitive subsequence of nums of size k. A subsequence is more competitive than another if at the first position where they differ, the subsequence has a smaller number.

Leetcode 1674: Minimum Moves to Make Array Complementary

You are given an integer array nums of even length n and an integer limit. In one move, you can replace any element of nums with another integer between 1 and limit (inclusive). The array nums is complementary if for all indices i, nums[i] + nums[n - 1 - i] equals the same number. Return the minimum number of moves required to make nums complementary.