All Posts

Leetcode 1415: The k-th Lexicographical String of All Happy Strings of Length n

A happy string consists of only the letters ‘a’, ‘b’, and ‘c’, and no two consecutive characters in the string are the same. Given two integers n and k, return the kth happy string of length n sorted in lexicographical order, or an empty string if there are fewer than k happy strings of length n.

Leetcode 1418: Display Table of Food Orders in a Restaurant

Given a list of customer orders in a restaurant, return a table where each row represents a table number and the columns represent the number of food items ordered at that table, sorted in lexicographical order.

Leetcode 1419: Minimum Number of Frogs Croaking

You are given a string croakOfFrogs, which represents a mix of sounds from multiple frogs croaking the word ‘croak’. Each frog croaks the sequence of letters: ‘c’, ‘r’, ‘o’, ‘a’, ‘k’. Your task is to determine the minimum number of frogs needed to croak all the sounds in the string, while following the correct letter sequence. If the string is not a valid combination of croaks, return -1.

Leetcode 1423: Maximum Points You Can Obtain from Cards

You are given an array cardPoints representing the points of cards arranged in a row. In each step, you can pick the first or the last card from the row. Your goal is to pick exactly k cards and maximize the sum of the points of the cards you select.

Leetcode 1424: Diagonal Traverse II

You are given a 2D array nums, where each sub-array represents a row in the grid. Your task is to return all the elements of nums in diagonal order, starting from the top-left to bottom-right diagonals, where the sum of the row and column indices is constant.

Leetcode 1432: Max Difference You Can Get From Changing an Integer

You are given an integer num and you must apply a set of operations twice to generate two new integers. The goal is to find the maximum difference between the results of these operations.