Array Wave Sort
MediumRearrange an array into a wave form where elements alternate between peaks and valleys: arr[0] >= arr[1] <= arr[2] >= ar...
Matrix Border Sum
MediumGiven a rectangular matrix, calculate the sum of all elements on the border (first row, last row, first column, last col...
String Rotation Check
MediumCheck if one string is a rotation of another string using only one substring operation. A rotation means you can move ch...
Odd Word Reversal
EasyGiven a sentence, reverse only the words at odd indices (1-indexed). Words are separated by spaces.
Alphabet Mirror
EasyReplace each letter with its "mirror" from the alphabet. A mirrors to Z, B mirrors to Y, C mirrors to X, and so on. Pres...
Lucky Ticket
EasyGiven a 6-digit number, determine if it's "lucky". A ticket is lucky if the sum of the first 3 digits equals the sum of...
Compact the Array
EasyRemove consecutive duplicates from an array, keeping only one occurrence of each consecutive group.
Count the Good Pairs
EasyFind the number of pairs (i,j) where nums[i] == nums[j] and i < j. Count all such valid pairs in the array.
Array Rotation Checker
MediumGiven two arrays, determine if one array is a rotation of another. A rotation means elements are shifted circularly.
Stock Price Analyzer
EasyGiven daily stock prices, find the maximum profit from buying and selling once. You must buy before you sell.