You are given two integer arrays, nums1 and nums2, both of the same length n. Your task is to construct a new array nums3 such that each element in nums3 is either taken from nums1 or nums2 at the same index. The goal is to maximize the length of the longest contiguous non-decreasing subarray in nums3.
You are given a 0-indexed integer array nums and a positive integer k. You can repeatedly select a contiguous subarray of size k and decrease all its elements by 1. Determine if it is possible to make all elements in nums equal to 0 using this operation.
Given a 0-indexed integer array nums of length n, an element x in nums is called dominant if freq(x) * 2 > n, where freq(x) is the number of occurrences of x in nums. It is guaranteed that nums contains exactly one dominant element. You can split nums into two non-empty subarrays at an index i such that the dominant element of the entire array is also the dominant element of both subarrays. Find the minimum index i where this condition holds, or return -1 if no such index exists.
You are given a string s. The task is to permute s such that all consonants remain in their original places, and the vowels are sorted in the nondecreasing order of their ASCII values.
You are given an integer array ’nums’ and a positive integer ‘x’. Starting at index 0, you can move to any position j (where i < j). For each position i that you visit, you get a score of nums[i]. If the parities of nums[i] and nums[j] differ, you lose a score of ‘x’. Your goal is to find the maximum score you can accumulate by visiting positions in the array.
You are given a 0-indexed array ’nums’ consisting of positive integers. You can repeatedly perform an operation where you choose an index ‘i’ such that ’nums[i] <= nums[i + 1]’, replace ’nums[i + 1]’ with ’nums[i] + nums[i + 1]’, and remove ’nums[i]’. Your task is to determine the largest possible value that can remain in the array after performing any number of operations.