
Given a string of digits and letters, reverse each group of 3 characters. If a group has less than 3 characters, reverse the entire string.
Explanation: Reversing each group of 3 characters: 'abc' becomes 'cba' and 'def' becomes 'fed', resulting in 'cbafed'
Explanation: Reversing each group of 3 characters: 'abc' becomes 'cba', 'def' becomes 'fed', and 'ghi' becomes 'ihg', resulting in 'cbadefihg'
Explanation: Since the label length is less than 3, the entire label is reversed, resulting in 'ba'
Access the full code editor, ThinkBuddy AI hints, and track your progress.