Showing 3 of 3 questions
You are given a string and a limit on how many characters you can remove. Your task is to minimize the length of the string after compressing it using run-length encoding, given the removal limit.
#1. String Compression II
You're given a number in its binary form. Determine the number of steps to reduce it to one by repeatedly dividing by two (if even) or adding one (if odd).
#2. Number of Steps to Reduce a Number in Binary Representation to One
Imagine assigning airplane seats randomly. Given the number of passengers, determine the probability that the last passenger gets their originally assigned seat.
#3. Airplane Seat Assignment Probability
Page 1 of 1 · 3 total