Pergunta de entrevista da empresa Capital One

Given an array of sorted integers, return a string array that contains the ranges of consecutive integers. Kinda like compression