Cody

# Problem 46943. Hash

Solution 3376293

Submitted on 25 Oct 2020 by Nikolaos Nikolaou
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
filetext = fileread('Ciph.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden') assert(isempty(strfind(filetext, 'if')),'if is forbidden')

2   Pass
r = 20; x=[1 5 2 6]; y_correct =3748; assert(isequal(Ciph(x,r),y_correct))

s = 3748

3   Pass
r = 5; x=[5 6 3 2 6]; y_correct =12872; assert(isequal(Ciph(x,r),y_correct))

s = 12872

4   Pass
r = 40; x=[4 8 6 8 5]; y_correct =83139; assert(isequal(Ciph(x,r),y_correct))

s = 83139

5   Pass
r = 110; x=[5 1 2 6 1 6 5 1 6 5]; y_correct =7348387387; assert(isequal(Ciph(x,r),y_correct))

s = 7.3484e+09

6   Pass
r = 10085; x=[5 1 6 5 1 6 5 1 5]; y_correct =162162161; assert(isequal(Ciph(x,r),y_correct))

s = 162162161

### Community Treasure Hunt

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

Start Hunting!