You are given a string letters made of N English letters. Count the number of different letters
Question:
You are given a string letters made of N English letters. Count the number of different letters that appear in both uppercase and lowercase where all lowercase occurrences of the given letter appear before any uppercase occurrence.
For example, for letters "aaAbcCABBc" the answer is The condition is met for letters a and b but not for c
Write a function:
function solutionletters: string: number;
that, given a string letters, returns the number of different letters fulfilling the conditions above.
Examples:
Given letters "aaAbcCABBc", the function should return as explained above.
Given letters "xyzXYZabcABC", the function should return
Given letters "ABCabcAefG", the function should return
Write an efficient algorithm for the following assumptions:
N is an integer within the range ; string letters is made only of letters az andor AZ
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch