Question: given. a string 'X' and a character 'Y', give the largest distance between any two occurance of the given chracter in the string. the distance
given. a string 'X' and a character 'Y', give the largest distance between any two occurance of the given chracter in the string.
the distance is given by the number of distinct characters between two ocuurances . if there is no occurance or only one occurance of the given character , the function should return -1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
