You are given a number n and a list of queries. Initially, an n x n matrix is filled with zeros. Each query updates either a row or a column in the matrix to a given value. After applying all the queries, compute and return the sum of all elements in the matrix.
You are given a three-digit integer n. We define a number as fascinating if, when you concatenate n, 2 * n, and 3 * n, the resulting number contains all digits from 1 to 9 exactly once and does not contain any zeros.
You are given a list of distinct strings words, where each string consists of exactly two lowercase English letters. You are tasked with finding the maximum number of pairs of strings that can be formed where one string is the reverse of the other.
Given a list of server requests and multiple queries specifying time intervals, determine the number of servers that did not receive any requests during each query’s time interval.
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 0-indexed integer array ’nums’ representing the initial positions of marbles. You are also provided with two arrays, ‘moveFrom’ and ‘moveTo’, where each step moves marbles from one position to another. After performing all the moves, return the sorted list of unique positions that have at least one marble.