All Posts

Leetcode 1929: Concatenation of Array

You are given an integer array nums and are required to return a new array where nums is repeated twice in a row.

Leetcode 1945: Sum of Digits of String After Convert

You are given a string consisting of lowercase English letters and an integer k. Your task is to convert the string into an integer by replacing each letter with its corresponding position in the alphabet (where ‘a’ = 1, ‘b’ = 2, …, ‘z’ = 26), and then repeatedly sum its digits k times. The final result is the integer obtained after performing the digit sum operation k times.

Leetcode 2011: Final Value of Variable After Performing Operations

In a simplified programming language, there are only four operations: incrementing or decrementing a variable X by 1. You are given a list of operations that can either increment or decrement the value of X. Your task is to determine the final value of X after applying all the operations.

Leetcode 2022: Convert 1D Array Into 2D Array

You are given a 1D integer array called ‘original’ and two integers ’m’ and ’n’. Your task is to convert this 1D array into a 2D array with ’m’ rows and ’n’ columns. The elements from the ‘original’ array should be placed row-wise in the new 2D array.

Leetcode 2028: Find Missing Observations

You are given an array of m observations, each representing a die roll from a 6-sided die, and an average value mean of all n + m rolls. Your task is to calculate the missing n observations such that the overall average of all n + m rolls equals the provided mean. If multiple valid answers exist, return any of them. If it is impossible to achieve the desired average, return an empty array.

Leetcode 2043: Simple Bank System

You are required to build a system for a bank that automates various account transactions, including deposits, withdrawals, and transfers. The bank has multiple accounts, and each transaction must adhere to specific rules to be considered valid. Implement a class that handles these operations efficiently while ensuring transactional integrity.