All Posts
Leetcode 2553: Separate the Digits in an Array
nums
consisting of positive integers. Your task is to return a new array where each integer from nums
is separated into its individual digits, while maintaining the order of the integers.
You are given an array Leetcode 2558: Take Gifts From the Richest Pile
gifts
where each element represents the number of gifts in different piles. Every second, you pick the pile with the most gifts and leave behind the floor of the square root of the number of gifts. Repeat this operation for k
seconds, and return the total number of gifts left in all piles.
You are given an integer array Leetcode 2562: Find the Array Concatenation Value
You are given an array of integers, nums
, and you need to calculate the total concatenation value. To calculate this, you repeatedly perform the following operations until the array is empty:
- If the array has more than one element, take the first and last elements, concatenate them, and add the result to the total concatenation value. Then remove the first and last elements from the array.
- If the array has only one element, add it to the total concatenation value and remove the element.
The goal is to return the total concatenation value after performing all the operations.