All Posts

Leetcode 1812: Determine Color of a Chessboard Square

You are given the coordinates of a square on a chessboard. The coordinate is represented as a string where the first character is a letter representing the column (‘a’ to ‘h’) and the second character is a number representing the row (‘1’ to ‘8’). Determine if the square is white or black. A square is white if the sum of its row and column is even, and black if it is odd.

Leetcode 1816: Truncate Sentence

Given a sentence with words separated by a space, truncate the sentence to contain only the first k words. Return the truncated sentence.

Leetcode 1822: Sign of the Product of an Array

You are given an integer array nums. The task is to compute the product of all the elements in the array and return the sign of the product. Implement the function signFunc(x) that returns 1 if x is positive, -1 if x is negative, and 0 if x is 0. Return signFunc(product) for the array.

Leetcode 1827: Minimum Operations to Make the Array Increasing

You are given an integer array nums. In one operation, you can increment any element of the array by 1. The goal is to make the array strictly increasing, meaning that each element should be smaller than the next. Return the minimum number of operations required to achieve this.

Leetcode 1832: Check if the Sentence Is Pangram

Given a string sentence consisting of lowercase English letters, determine whether the sentence contains every letter of the English alphabet at least once.

Leetcode 1837: Sum of Digits in Base K

Given an integer n in base 10 and a base k, convert n to base k and return the sum of the digits in base 10.