Ripple interview question

Coderpad round - String Compression SQL query array sum to k