Let’s start from the easy (as for me) one:
3. You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups by N dashes.
Given a number K, we would want to reformat the strings such that each group contains exactly…
Write a function
solution that, given a string S of N lowercase English letters, returns a string with no instances of three identical consecutive letters, obtained from S by deleting the minimum possible number of letters.
Ok, so I’ve got three functions. They seem to be correct (at the very least they work for the stated test cases). I have had most difficult optimising the second one, and do not think I’ve done it yet. Not sure about the other two.
Really looking forward to seeing some commentary on these solutions (and the “proper” ones)…