Cody

# Problem 1674. How many jokers?

Solution 2801695

Submitted on 6 Aug 2020 by Cassidy Fialkiewicz
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
suspects = [431 543 211 911 436]; code = 211; jokers = 1; assert(isequal(mytest(suspects,code),jokers))

check = 1×5 logical array 0 0 1 0 0 jokers = 1

2   Pass
suspects = [431 543 211 911 436]; code = 217; jokers = 0; assert(isequal(mytest(suspects,code),jokers))

check = 1×5 logical array 0 0 0 0 0 jokers = 0

3   Pass
suspects = 100:200; code = 160; jokers = 1; assert(isequal(mytest(suspects,code),jokers))

check = 1×101 logical array Columns 1 through 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 46 through 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 91 through 101 0 0 0 0 0 0 0 0 0 0 0 jokers = 1

4   Pass
suspects = [100 200 300 350 200]; code = 200; jokers = 2; assert(isequal(mytest(suspects,code),jokers))

check = 1×5 logical array 0 1 0 0 1 jokers = 2

### Community Treasure Hunt

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

Start Hunting!