[LeetCode] Find Longest Special Substring That Occurs Thrice II

10033. Find Longest Special Substring That Occurs Thrice II

You are given a string s that consists of lowercase English letters.

A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

A substring is a contiguous non-empty sequence of characters within a string.

Read more
[LeetCode] Find Longest Special Substring That Occurs Thrice I

10032. Find Longest Special Substring That Occurs Thrice I

You are given a string s that consists of lowercase English letters.

A string is called special if it is made up of only a single character. For example, the string "abc" is not special, whereas the strings "ddd", "zz", and "f" are special.

Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.

A substring is a contiguous non-empty sequence of characters within a string.

Read more
[LeetCode] Check if Bitwise OR Has Trailing Zeros

10031. Check if Bitwise OR Has Trailing Zeros

You are given an array of positive integers nums.

You have to check if it is possible to select two or more elements in the array such that the bitwise OR of the selected elements has at least one trailing zero in its binary representation.

For example, the binary representation of 5, which is "101", does not have any trailing zeros, whereas the binary representation of 4, which is "100", has two trailing zeros.

Return true if it is possible to select two or more elements whose bitwise OR has trailing zeros, return false otherwise.

Read more
[Codeforces] Alpha Round 21 (Codeforces format) C. Stripe 2Read more
[Codeforces] Beta Round 26 (Codeforces format) C. ParquetRead more
[Codeforces] Beta Round 27 (Codeforces format, Div. 2) E. Number With The Given Amount Of DivisorsRead more
[Codeforces] Beta Round 29 (Div. 2, Codeforces format) D. Ant on the TreeRead more
[LeetCode] Largest Substring Between Two Equal Characters

1624. Largest Substring Between Two Equal Characters

Given a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.

A substring is a contiguous sequence of characters within a string.

Read more
[Codeforces] Beta Round 31 (Div. 2, Codeforces format) D. ChocolateRead more
[LeetCode] Redistribute Characters to Make All Strings Equal

1897. Redistribute Characters to Make All Strings Equal

You are given an array of strings words (0-indexed).

In one operation, pick two distinct indices i and j, where words[i] is a non-empty string, and move any character from words[i] to any position in words[j].

Return true if you can make every string in words *equal using any number of operations, and false otherwise*.

Read more