All Posts

Leetcode 1448: Count Good Nodes in Binary Tree

Given the root of a binary tree, a node is considered ‘good’ if in the path from the root to that node, there are no nodes with a value greater than the node itself. Return the total number of good nodes in the tree.

Leetcode 1451: Rearrange Words in a Sentence

Given a sentence consisting of space-separated words, rearrange the words in the sentence such that they are ordered by increasing length. Words with the same length should retain their original order. The first word of the rearranged sentence must start with a capital letter, and all other words must be in lowercase.

Leetcode 1452: People Whose List of Favorite Companies Is Not a Subset of Another List

Given an array of lists where favoriteCompanies[i] represents the favorite companies of the i-th person, find the indices of people whose favorite company lists are not subsets of any other person’s list. Return these indices in increasing order.

Leetcode 1456: Maximum Number of Vowels in a Substring of Given Length

You are given a string s consisting of lowercase English letters and an integer k. Your task is to find the maximum number of vowels in any substring of length k. Vowels in English are ‘a’, ’e’, ‘i’, ‘o’, and ‘u’.

Leetcode 1457: Pseudo-Palindromic Paths in a Binary Tree

You are given a binary tree where each node contains a digit from 1 to 9. A path from the root to a leaf node is considered pseudo-palindromic if at least one permutation of the node values in the path can form a palindrome. Your task is to return the number of pseudo-palindromic paths in the tree.

Leetcode 1461: Check If a String Contains All Binary Codes of Size K

You are given a binary string s and an integer k. Your task is to determine if every possible binary code of length k appears as a substring within s. Return true if all such binary codes are present, otherwise return false.