Longest Subsequence Repeated k Times — CaffeCode