You are given an n x n matrix where each element is an integer. The matrix is considered valid if every row and every column contains all the integers from 1 to n (inclusive). Your task is to check whether the given matrix satisfies this condition. Return true if the matrix is valid, and false otherwise.
Given a string s and an integer k, partition the string into groups of size k. If the last group has fewer than k characters, append a fill character to complete it. Return an array of the groups.
A shop offers a special deal: for every two candies you purchase, you get a third candy for free. The free candy must have a cost that is less than or equal to the minimum cost of the two candies purchased. Calculate the minimum cost of purchasing all candies.
You are given an integer array ’nums’. Your task is to return the count of elements in the array that have both a strictly smaller and a strictly greater number in the array. Each element should have at least one number strictly smaller and one number strictly greater.
You are given an array of integers ’nums’ and an integer ‘original’. Start with the number ‘original’ and search for it in the array. If found, multiply it by two. Repeat this process until ‘original’ is no longer found in ’nums’. Return the final value of ‘original’.
You are given a four-digit integer ’num’. Your task is to split this number into two new integers, ’new1’ and ’new2’, by rearranging its digits. The digits in ’num’ must be used in their entirety, and leading zeros are allowed in ’new1’ and ’new2’. Your goal is to return the minimum possible sum of ’new1’ and ’new2'.