function tf = isPangram(s)
s1='QWERTYUIOPASDFGHJKLZXCVBNM';
L=strlength(s);
cnt=0;
s2=upper(s);
for i=1:26
if isempty(findstr(s1(i),s2))==false
cnt=cnt+1;
continue;
end
end
if cnt==26
tf=true;
else
tf=false;
end
end
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 'The quick brown fox jumps over a lazy dog';
y_correct = true;
assert(isequal(isPangram(x),y_correct))
|
2 | Pass |
x = 'The quick brown fox jumped over a lazy dog';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
3 | Pass |
x = 'Pack my box with five dozen liquor jugs';
y_correct = true;
assert(isequal(isPangram(x),y_correct))
|
4 | Pass |
x = 'Pack my box with four dozen liquor jugs';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
5 | Pass |
x = 'Sphinx of black quartz, judge my vow';
y_correct = true;
assert(isequal(isPangram(x),y_correct))
|
6 | Pass |
x = 'Sphinx of black onyx, judge my vow';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
7 | Pass |
x = 'Wonderful watermelon, bringer of life.';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
8 | Pass |
x = 'Dastardly dumpling, harbinger of doom!';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
9 | Pass |
x = 'AbcDE FgHiJKl mmoPQrstuV Wxyz';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
10 | Pass |
x = 'With quiz game Cody for MATLAB, expect perverse junk.';
y_correct = true;
assert(isequal(isPangram(x),y_correct))
|
11 | Pass |
x = 'Punctuation marks like @#$%^</&>*?!!, when used in cartoons to stand in for swearing, are called "grawlix".';
y_correct = false;
assert(isequal(isPangram(x),y_correct))
|
Determine whether a vector is monotonically increasing
11922 Solvers
3968 Solvers
Set the array elements whose value is 13 to 0
938 Solvers
2776 Solvers
2632 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!