You are given a lock with 4 rotating wheels, each containing 10 slots labeled ‘0’ to ‘9’. The wheels can rotate freely and wrap around. You must determine the minimum number of moves required to reach a target lock configuration, avoiding certain deadends.
You are given an integer n, which represents the size of an n x n binary grid. Initially, all the values in the grid are set to 1, except for some indices that are specified in the array mines. Your task is to find the order of the largest axis-aligned plus sign of 1’s in the grid. A plus sign of order k has a center grid[r][c] == 1 with arms extending in all four directions (up, down, left, right) of length k - 1.
You are given an integer array arr of length n, where the array is a permutation of integers in the range [0, n - 1]. Your task is to split this array into as many chunks (or partitions) as possible, where each chunk can be individually sorted. After sorting each chunk, when concatenated, the result should be the same as the fully sorted array. Return the largest number of chunks that you can create to achieve the sorted array.
You are given an integer array nums of length n, which is a permutation of all integers in the range [0, n - 1]. A global inversion is a pair of indices (i, j) such that 0 <= i < j < n and nums[i] > nums[j]. A local inversion is a pair where 0 <= i < n - 1 and nums[i] > nums[i + 1]. Return true if the number of global inversions is equal to the number of local inversions.
In a forest, there are an unknown number of rabbits. We ask n rabbits, ‘How many rabbits of the same color as you are there?’ and collect their answers in an integer array answers, where answers[i] is the answer of the i-th rabbit. The task is to determine the minimum number of rabbits that could be in the forest.
You are given a sorted array of prime numbers and the number 1. You need to find the k-th smallest fraction formed by considering all possible fractions arr[i] / arr[j] where i < j. Return the k-th smallest fraction as an array of two integers, where arr[i] is the numerator and arr[j] is the denominator.