You are given an array of integers sorted in non-decreasing order. Your task is to determine the maximum count between the number of positive integers and the number of negative integers in the array. Zero is not considered positive or negative.
You are given two strings, word1 and word2. In each move, you swap one character from word1 with one from word2. Determine if it is possible to make the number of distinct characters in both strings equal with exactly one swap.
You are given a 0-indexed integer array nums. You can rearrange the elements of nums to any order (including the given order). Define the prefix sum array of nums as prefix[i] = sum(nums[0] to nums[i]) after rearranging. The score of nums is the number of positive integers in the prefix array. Return the maximum score you can achieve by rearranging the elements of nums.
You are given an array ’nums’ containing integers. A pair of indices ‘i, j’ is considered beautiful if the first digit of nums[i] and the last digit of nums[j] are coprime. Two numbers are coprime if their greatest common divisor (GCD) is 1, i.e., ‘gcd(x, y) == 1’. Your task is to find the total number of beautiful pairs in nums.
You are given a string moves consisting of characters ‘L’, ‘R’, and ‘’. The string represents movements on a number line starting from position 0. You can choose to move left or right when the character is ‘’, and the goal is to calculate the maximum distance from the origin you can reach after completing all the moves.
You are given a non-decreasing sorted integer array. Perform operations to remove pairs of elements where nums[i] < nums[j] and return the minimum length of the array after the operations.