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.
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.
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.
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.
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.
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.