String compression 2016-08-09 algorithm Write a function compress(str), which shortens strings by reducing consecutive character repetitions.Note: input string will only contain [a-z]+example:compress('aaaabbaaaababbbcccccccccccc');// a4b2a4b1a1b3c12 Newer A task to handle URI Older The smallest palindrome