Write a function to compress the given string? function solve( a ){ //write your code here } Login to Submit
Input: "bat" Output: "b1a1t1" Input: "peeeeeen" Output: "p1e6n1"