All Posts

Leetcode 1814: Count Nice Pairs in an Array

You are given an array of non-negative integers. A pair of indices (i, j) is nice if nums[i] + rev(nums[j]) equals nums[j] + rev(nums[i]). Return the number of nice pairs modulo 10^9 + 7.

Leetcode 1817: Finding the Users Active Minutes

Given the logs of users’ actions on a platform, calculate the number of users with each possible User Active Minutes (UAM) from 1 to k.

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 1865: Finding Pairs With a Certain Sum

You are given two integer arrays nums1 and nums2. Your task is to implement a data structure that supports two types of operations: 1) Add a value to an element in nums2. 2) Count the number of pairs (i, j) such that nums1[i] + nums2[j] equals a given total value.

Leetcode 1876: Substrings of Size Three with Distinct Characters

You are given a string s, and your task is to find the number of substrings of length 3 that contain no repeated characters. A substring is considered ‘good’ if all its characters are unique. Note that if a ‘good’ substring appears more than once, it should be counted multiple times.

Leetcode 1893: Check if All the Integers in a Range Are Covered

You are given a list of integer ranges and two integers, left and right. Each range is represented by a pair of integers [start, end]. You need to determine if all integers from left to right (inclusive) are covered by at least one of these ranges. An integer x is considered covered by a range [start, end] if start <= x <= end.