All Posts

Leetcode 1442: Count Triplets That Can Form Two Arrays of Equal XOR

You are given an array of integers arr. We want to find the number of triplets (i, j, k) where 0 <= i < j <= k < arr.length, such that the bitwise XOR of elements between indices i and j-1 (inclusive) equals the bitwise XOR of elements between indices j and k (inclusive).

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.

Leetcode 1525: Number of Good Ways to Split a String

You are given a string s. You need to determine the number of valid ways to split s into two non-empty substrings such that the number of distinct letters in the left and right substrings is the same.

Leetcode 1680: Concatenation of Consecutive Binary Numbers

Given an integer n, form a binary string by concatenating the binary representations of all integers from 1 to n. Convert this concatenated binary string to its decimal equivalent and return the result modulo 10^9 + 7.

Leetcode 1684: Count the Number of Consistent Strings

You are given a string allowed consisting of distinct characters, and an array of strings words. A string is consistent if all characters in the string appear in the string allowed. Return the number of consistent strings in the array words.