Cody

Problem 44697. count upper and lower case characters

Solution 2883752

Submitted on 27 Aug 2020 by Jerry Wright
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
str = 'This is a Test Case'; ans_corr = [3 12]; assert(isequal(counter_ul(str),ans_corr))

ans = 3 12

2   Pass
str = 'RandoM'; ans_corr = [2 4]; assert(isequal(counter_ul(str),ans_corr))

ans = 2 4

3   Pass
str = 'Hello World'; ans_corr = [2 8]; assert(isequal(counter_ul(str),ans_corr))

ans = 2 8

4   Pass
str = 'HELLO WORLD'; ans_corr = [10 0]; assert(isequal(counter_ul(str),ans_corr))

ans = 10 0

5   Pass
str = 'hello world'; ans_corr = [0 10]; assert(isequal(counter_ul(str),ans_corr))

ans = 0 10

6   Pass
str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; ans_corr = [26 0]; assert(isequal(counter_ul(str),ans_corr))

ans = 26 0

7   Pass
str = 'abcdefghijklmnopqrstuvwxyz'; ans_corr = [0 26]; assert(isequal(counter_ul(str),ans_corr))

ans = 0 26

8   Pass
str = '42'; ans_corr = [0 0]; assert(isequal(counter_ul(str),ans_corr))

ans = 0 0

9   Pass
str = 'Matlab'; ans_corr = [1 5]; assert(isequal(counter_ul(str),ans_corr))

ans = 1 5

Suggested Problems

More from this Author29

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!