In a special square room with mirrors on all four walls, except for the southwest corner, there are receptors at three other corners, numbered 0, 1, and 2. A laser ray is fired from the southwest corner and hits the east wall at a certain distance from the 0th receptor. Given the side length of the square room, p, and the distance q from the 0th receptor on the east wall where the laser ray meets, return the number of the receptor the ray hits first after bouncing around the room.
Given an integer n, find the smallest integer that is both a prime number and a palindrome, and is greater than or equal to n. A prime number is an integer greater than 1 with no divisors other than 1 and itself. A palindrome is a number that reads the same forwards and backwards.
Given an integer n, check if it is possible to reorder its digits (in any order, including the original order) to form a number that is a power of two. Leading digits cannot be zero in the reordered number.
Alice and Bob are playing a game with an array of piles of stones. Each pile contains a positive number of stones, and the game proceeds as follows: Alice and Bob take turns, with Alice starting first. On each turn, a player can choose the entire pile of stones either from the beginning or the end of the array. The player who ends up with the most stones wins. Given the piles array, return true if Alice wins the game, or false if Bob wins, assuming both players play optimally.
You are given an integer array nums and an integer k. For each element in nums, you can either add or subtract k. The score of the array is calculated as the difference between the maximum and minimum elements of the modified array. Your task is to find and return the minimum possible score after modifying the values in the array.
You are given a set of points in a 2D plane, represented by an array where each point is a pair of integers [xi, yi]. Your task is to find the minimum area of a rectangle that can be formed using these points, with sides parallel to the X and Y axes. If no such rectangle can be formed, return 0.