Showing 3 of 6 questions
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.
#1. String Compression
You have a certain number of coins. Determine how many complete rows of coins you can form in a staircase shape, where each row has one more coin than the row above.
#2. Arranging Coins
You are given a collection of intervals. Merge all overlapping intervals into a single interval and return the result.
#3. Merge Intervals