diff --git a/cs/make-string-a-subsequence-using-cyclic-increments.cs b/cs/make-string-a-subsequence-using-cyclic-increments.cs new file mode 100644 index 0000000..67367e4 --- /dev/null +++ b/cs/make-string-a-subsequence-using-cyclic-increments.cs @@ -0,0 +1,12 @@ +public class Solution { + public bool CanMakeSubsequence(string str1, string str2) { + int j = 0; + for (int i = 0; i < str1.Length && j < str2.Length; ++i) { + if (str1[i] == str2[j] || str1[i] + 1 == str2[j] || str1[i] - 25 == str2[j]) { + ++j; + } + } + + return j == str2.Length; + } +}