All Posts

Leetcode 2396: Strictly Palindromic Number

An integer n is considered strictly palindromic if, for every base b between 2 and n - 2 (inclusive), the representation of n in base b is a palindrome. A number is palindromic in a base if the string representation of that number in that base reads the same forward and backward. Your task is to determine if the given integer n is strictly palindromic or not.

Leetcode 2406: Divide Intervals Into Minimum Number of Groups

You are given a 2D array of intervals, where each interval is represented as a pair of integers [left, right], denoting an inclusive range. Your task is to divide these intervals into the minimum number of groups such that no two intervals within the same group overlap. Two intervals overlap if there is at least one common number between them.

Leetcode 2410: Maximum Matching of Players With Trainers

You are given two arrays: ‘players’ and ’trainers’. The array ‘players’ represents the abilities of different players, and the array ’trainers’ represents the training capacities of various trainers. A player can be matched with a trainer if the player’s ability is less than or equal to the trainer’s capacity. The goal is to find the maximum number of valid matchings between players and trainers such that each player is matched with at most one trainer and vice versa.

Leetcode 2441: Largest Positive Integer That Exists With Its Negative

You are given an integer array nums where each element is non-zero. Your task is to find the largest positive integer k such that its negative counterpart -k also exists in the array. Return the largest such k. If no such integer exists, return -1.

Leetcode 2460: Apply Operations to an Array

You are given an array of non-negative integers. You need to perform a series of operations on this array where, in each operation, you compare adjacent elements. If the elements are equal, you double the value of the first element and set the second element to zero. After performing these operations on all pairs, shift all the zeros to the end of the array. Return the resulting array.

Leetcode 2462: Total Cost to Hire K Workers

You are given an array of integers where each element represents the cost of hiring a worker. You need to hire exactly k workers by running k sessions. In each session, choose the worker with the lowest cost from either the first ‘candidates’ workers or the last ‘candidates’ workers. If there is a tie, choose the worker with the smallest index.