using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WinKeyRecover { internal class ReplaceMissings { private readonly string key; private readonly List missingPosition; public ReplaceMissings(string key, List missingPosition) { this.key = key; this.missingPosition = missingPosition; } public string Replace(string pattern) { char[] finalKey = new List(key).ToArray(); for (int i = 0; i < pattern.Length; i++) { finalKey[missingPosition[i]] = pattern[i]; } return new string(finalKey); } } }