Twin Health Interview Question

1 . https://leetcode.com/problems/string-compression/ 2 . decode string

Interview Answer

Anonymous

Mar 11, 2022

public int compress(char[] chars) { int i = 0, n = chars.length; int k = 0; while (i 1) { for (char c : String.valueOf(counter).toCharArray()) chars[k++] = c; } i = j; } return k; }