Cody

Problem 44856. Permutation Via Multiplication

Solution 3297688

Submitted on 20 Oct 2020
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   Fail
a = 0; b = 2; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)]

Assertion failed.

2   Fail
a = 15; b = 7; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)]

Assertion failed.

3   Fail
a = 1035; b = 3; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)]

Assertion failed.

4   Fail
a = 125874; b = 2; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)]

Assertion failed.

5   Pass
a = 10; b = 2; tf_correct = false; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint5 (line 4) In solutionTest (line 11)]

6   Fail
a = 123; b = 10; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint6 (line 4) In solutionTest (line 13)]

Assertion failed.

7   Pass
a = 67; b = 2; tf_correct = false; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint7 (line 4) In solutionTest (line 15)]

8   Fail
a = 1025874; b = 2; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint8 (line 4) In solutionTest (line 17)]

Assertion failed.

9   Fail
a = 459; b = 11; tf_correct = true; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint9 (line 4) In solutionTest (line 19)]

Assertion failed.

10   Pass
a = 461; b = 11; tf_correct = false; assert(isequal(product_is_perm(a,b),tf_correct))

[Warning: Invalid format.] [> In num2str>cellPrintf (line 175) In num2str (line 122) In product_is_perm (line 3) In ScoringEngineTestPoint10 (line 4) In solutionTest (line 21)]

Suggested Problems

Community Treasure Hunt

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

Start Hunting!