cpp

[Solved] Number of Excellent Pairs LeetCode Contest Problem

[Solved] Number of Excellent Pairs LeetCode Contest Problem

You are given a 0-indexed positive integer array nums and a positive integer k. A pair of numbers (num1, num2) is called excellent if the following conditions are satisfied: Both the numbers num1 and num2 exist in the array nums. The sum of the number of set bits in num1 OR num2 and num1 AND num2 is greater than…

[Solved] First Letter to Appear Twice LeetCode Contest Problem

[Solved] First Letter to Appear Twice LeetCode Contest Problem

Given a string s consisting of lowercase English letters, return the first letter to appear twice. Note: A letter a appears twice before another letter b if the second occurrence of a is before the second occurrence of b. s will contain at least one letter that appears twice. First Letter to Appear Twice LeetCode Contest…