![]() |
VOOZH | about |
Given a string find its first uppercase letter
Examples :
Input : geeksforgeeKs Output : K Input : geekS Output : S
Method 1: linear search
Using linear search, find the first character which is capital
Output:
G
Time Complexity : O(N)
Auxiliary Space: O(1)
Method 2 (Using recursion)
Recursively traverse the string and if any uppercase is found return that character
Output :
G
Time Complexity : O(N)
Auxiliary Space: O(N) for call stack