All Posts

Leetcode 2293: Min Max Game

You are given an integer array nums where the length of the array is a power of 2. The task is to apply a repeated algorithm to reduce the array size. In each iteration, if the index of an element is even, the new value at that index will be the minimum of two adjacent elements; if the index is odd, the new value will be the maximum. The process continues until only one element remains, which is the result.

Leetcode 2299: Strong Password Checker II

A strong password is defined by the following criteria:

  1. It must contain at least 8 characters.
  2. It must have at least one lowercase letter.
  3. It must have at least one uppercase letter.
  4. It must have at least one digit.
  5. It must have at least one special character from the set: ‘!@#$%^&*()-+’.
  6. It cannot contain two consecutive identical characters. Given a string password, return true if the password satisfies all these conditions. Otherwise, return false.

Leetcode 2309: Greatest English Letter in Upper and Lower Case

Given a string s consisting of both uppercase and lowercase English letters, return the greatest letter that appears as both a lowercase and uppercase letter in the string. The returned letter should be in uppercase. If no such letter exists, return an empty string.

Leetcode 2315: Count Asterisks

You are given a string s, where every two consecutive vertical bars ‘|’ form a pair. Count the number of ‘’ in s, excluding the ‘’ between each pair of ‘|’.

Leetcode 2319: Check if Matrix Is X-Matrix

A matrix is called an X-Matrix if all elements along the diagonals are non-zero, and all elements outside the diagonals are zero. Given a 2D integer array grid representing a matrix, return true if it is an X-Matrix, otherwise return false.

Leetcode 2325: Decode the Message

Given a cipher key and a secret message, decode the message by replacing each letter with the corresponding letter in the alphabet based on the first appearance of each letter in the key. Spaces in the message remain unchanged.