Given a string s representing a license key and an integer k, reformat s so that the groups of characters are separated by dashes and each group contains exactly k characters, except possibly the first group, which may contain fewer than k characters.
The reformatted string should use uppercase letters only. Remove all existing dashes from s before grouping the characters.
Return the reformatted license key.
Constraints:
s.length
s consists of English letters, digits, and dashes '-'.
k
Given a string s representing a license key and an integer k, reformat s so that the groups of characters are separated by dashes and each group contains exactly k characters, except possibly the first group, which may contain fewer than k characters.
The reformatted string should use uppercase letters only. Remove all existing dashes from s before grouping the characters.
Return the reformatted license key.
Constraints:
s.length
s consists of English letters, digits, and dashes '-'.
k