public int MovesToMatch(StringReduced other) { int moves = 0; for (int i = 0; i < this.substrings.Count; i++) { moves += Math.Abs(this.substrings[i].Item2 - other.substrings[i].Item2); } return(moves); }
public bool CanMatch(StringReduced other) { // if number of substrings is different, they can't match if (this.substrings.Count != other.substrings.Count) { return(false); } // if order is different, they can't match for (int i = 0; i < this.substrings.Count; i++) { if (this.substrings[i].Item1 != other.substrings[i].Item1) { return(false); } } return(true); }