Given a password policy—length between 8 and 20 characters; must include at least one lowercase letter, one uppercase letter, and one digit; and must not contain any character repeated three or more times consecutively—write a function that (a) validates whether an input string is compliant and (b) if not, returns the minimum number of edits (insert, delete, replace) needed to make it compliant along with one valid corrected password. Describe your algorithm, consider large inputs, and analyze time/space complexity.