Question: C++ or Java Complete the function firstRepeatingLetter in your editor. I has parameter: 1. A string. t must retum the first repeating letter in a

C++ or Java Complete the function firstRepeatingLetter in your editor. I hasC++ or Java

Complete the function firstRepeatingLetter in your editor. I has parameter: 1. A string. t must retum the first repeating letter in a stning l.e. the character which occurs more than once in a given stringl Note: Treat the string as case sensitive, so'a' and'A' are different characters for the purposes of finding repetitions. If multiple characters recur, pick the one whose first occurrence is sooner, not the one whose second occurrence is soone Input Format The locked stub code in your cditor reads the following input from stdin and passes it to your function The first line contains a single strings Constraints String consists of alphabet lelters in uppercase and vcasA-7anci a- It is guaranteed that at least one letter will appear at more thari one places at least r Output Format our function must return the first repeating letter in a string ue. the character which occurs more than once in a given string. This is printed to stdout by the locked stub code in your editor. Sample Input 1 bt ba Sample Output 1 Explanation yi ocour oth aand 'b'ocour twic co. Since tho first occurranco of ais bafare the first occurranca of 'b, ais the arawor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!