Company: Amazon_25july
Difficulty: medium
First Unique Character Problem Description Amazon Web Services is experimenting with optimizing search queries based on the location of the first unique character in a search. A unique character is one which appears only once in a string. Given a string consisting of lowercase English letters only, return the index of the first occurrence of a unique character in the string using 1-based indexing. If the string does not contain any unique character, return -1. Complete the function findFirstUnique in the editor below. The function findFirstUnique has the following parameter: string s : a string The function is expected to return an INTEGER : either the 1-based index or -1. /* * Complete the 'findFirstUnique' function below. * * The function is expected to return an INTEGER. * The function accepts STRING s as parameter. */ int findFirstUnique(string s) { } Examples Example 1: Input: s = "statistics" Output: 3 Explanation: The unique characters are 'a' and 'c'. Among these, 'a' occurs fi