You are given a 3x3 grid representing stones placed in each cell. In one move, you can move a stone from its current cell to an adjacent cell. The goal is to place one stone in each cell, minimizing the number of moves.
You are given a non-decreasing sorted integer array. Perform operations to remove pairs of elements where nums[i] < nums[j] and return the minimum length of the array after the operations.
You are given a list of integers where each integer represents a student’s happiness threshold. The task is to determine the number of ways to select a group of students so that all students in the group remain happy.
You are running a company that manufactures alloys using various types of metals. There are n different metal types available, and you have k machines that can be used to create alloys. Each machine requires a specific amount of each metal type to create an alloy. The i-th machine requires composition[i][j] units of metal type j. You have stock[i] units of metal type i, and purchasing one unit of metal type i costs cost[i] coins. Your task is to maximize the number of alloys you can produce while staying within a budget of budget coins. Each alloy must be made using the same machine.
You are given an array heights representing the number of bricks in n consecutive towers. Your task is to remove some bricks to form a mountain-shaped tower arrangement. In this arrangement, the tower heights are non-decreasing, reaching a maximum peak value with one or multiple consecutive towers and then non-increasing. Return the maximum possible sum of heights of a mountain-shaped tower arrangement.