All Posts

Leetcode 1920: Build Array from Permutation

Given a zero-based permutation nums (0-indexed), build a new array ans of the same length where for each i, ans[i] = nums[nums[i]]. Return the array ans. A zero-based permutation means that the array consists of distinct integers from 0 to nums.length - 1 (inclusive).

Leetcode 1925: Count Square Sum Triples

Given an integer n, count how many square triples (a, b, c) satisfy the equation a^2 + b^2 = c^2 where 1 <= a, b, c <= n. The order of a, b, and c matters.

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 1935: Maximum Number of Words You Can Type

You are given a string ’text’ consisting of words separated by a single space and a string ‘brokenLetters’ containing the broken keys on a malfunctioning keyboard. Return the number of words in ’text’ that can be fully typed using the working keys.

Leetcode 1941: Check if All Characters Have Equal Number of Occurrences

Given a string s, determine if it is a ‘good’ string. A string is considered good if every character in it appears the same number of times.

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.