Showing 3 of 3 questions
Given a sorted array, find the first and last position of a given target value. If the target is not found, return [-1, -1].
#1. Find First and Last Position of Element in Sorted Array
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.
#2. String Compression
Find two numbers in a given array that add up to a specific target value, and return their indices. Essentially, you need to efficiently locate the pair that satisfies the sum requirement.
#3. Two Sum
Page 1 of 1 · 3 total