Given two strings S1 and S2 of equal lengths. Find the Lexicographically smaller string considering letters case insensitive.
EXPLANATION:
Input strings can contain both uppercase or lowercase letters. But we have to consider letters case insensitive while comparing the strings. So, first of all convert both strings to either LOWERCASE or UPPERCASE. After that process each character of the stings simultaneously and compare their ASCII values.
I would suggest you to please once go through the implementation of comparison operator and study how it works in case of strings. It’s complexity is O(N) not O(1). It’s ok to use Library functions. But you should also have a fair idea of what’s going behind the scenes. Also, Conversion of a string to lower case itself is a O(N) operation where N is length of string.