Problem 242. Make a function that returns its own character count
Solution Stats
Problem Comments
-
1 Comment
I'm not sure if I've understood the test correctly.
ha = histc(file{1},1:128);
hp = omphaloskeptic;
assert(~any(ismember(33:41,find(ha))),'Used an illegal character');
This assertion checks if forbidden characters are used in ha, which is the histogram of the file content. However, our output is hp, which is the histogram produced by the function omphaloskeptic. Shouldn't the assertion check for forbidden characters in hp, not ha, or am I missing something?
Solution Comments
Show commentsProblem Recent Solvers33
Suggested Problems
-
Back to basics 13 - Input variables
356 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
507 Solvers
-
Split a string into chunks of specified length
2034 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
2026 Solvers
-
Count letters occurence in text, specific to words with a given length.
192 Solvers
More from this Author50
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!