I have got two strings of equal length. Each string contains digits '1' to '9'.
I want to calculate the number of indexes where the character at that index is same between the two strings.
Example:
A = "1322113" and
B = "2312213"
then the output should be 4 as characters at 1st, 3rd, 5th and 6th index are same (considering 0 based indexing).
I know about the naive solution of iterating and checking {O(n)}. Is there any library or technique which can give me better time complexity?