Showing 3 of 202 questions
You're managing a power grid and need to schedule maintenance. Determine the minimum number of maintenance periods required to ensure no two adjacent power lines are down simultaneously.
#1. Power Grid Maintenance
Find the minimum number of operations to reduce a given positive integer to 0. You can either subtract a power of 2 or add a power of 2 in each operation.
#2. Minimum Operations to Reduce an Integer to 0
Compress a given string by replacing consecutive repeating characters with the character followed by the count of repetitions. If the compressed string isn't shorter, return the original.
#3. String Compression