Showing 7 questions
Determine the number of '1' bits present in the binary representation of a given integer. Essentially, count how many bits are set to one.
#1. Number of 1 Bits
Find the k most frequently occurring words in a given list of words. Return the top k words sorted by frequency, and then alphabetically for words with the same frequency.
#2. Top K Frequent Words
Transform one word into another, one letter at a time, using only words from a given dictionary. Find the shortest sequence of words to reach the target.
#3. Word Ladder
Determine if a binary tree is univalued, meaning every node has the same value. You need to check if all nodes in the tree contain the same value.
#4. Univalued Binary Tree
Implement an event emitter class that allows subscribing to and emitting events. The class should handle multiple subscribers for the same event and allow unsubscribing.
#5. Event Emitter
Given an array, rotate the elements to the right by a specified number of steps. The goal is to modify the original array in-place with the rotated elements.
#6. Rotate Array
You're given a graph represented by a list of edges. Find and return the edge that, when removed, makes the graph a tree (removes the cycle).
#7. Redundant Connection