Given a positive integer num, determine how many of its digits divide num without leaving a remainder. In other words, for each digit in num, check if num % digit == 0 and count how many digits satisfy this condition.
Given an array of positive integers nums, find the number of distinct prime factors in the product of all the elements in the array. A prime factor of a number is a number that divides it evenly, and only divisible by 1 and itself. The goal is to calculate the distinct prime factors present in the prime factorization of the product of all elements in nums.
Given two integers left and right, find the two prime numbers num1 and num2 such that: left <= num1 < num2 <= right, both are prime numbers, and the difference num2 - num1 is the smallest among all valid pairs. If multiple pairs have the same smallest difference, return the pair with the smallest num1. If no such pair exists, return [-1, -1].
Given the dimensions and mass of a box, categorize it based on the following conditions: If any dimension is >= 10,000 or the volume is >= 1,000,000,000, the box is ‘Bulky’. If the mass is >= 100, the box is ‘Heavy’. The box can be categorized as ‘Both’, ‘Heavy’, ‘Bulky’, ‘Neither’, or a combination of the categories.
You are given an integer array nums. The xor-beauty of the array is the XOR of the effective values of all possible triplets of indices (i, j, k) where 0 <= i, j, k < n. The effective value for each triplet is calculated as ((nums[i] | nums[j]) & nums[k]).