Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 105728

Submitted on 3 Jul 2012

Incorrect

47Size
Leading solution size is 12.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
s='ThE qUiCk BrOwN fOx JuMpEd OvEr ThE lAzY dOg';
se = 'YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU fPh';
assert(isequal(Qwerty_encode(s),se))
encoded_str =
     []
su =
snvfrghjokl;,mp[wtdyibecuxSNVFRGHJOKL:<MP{WTDYIBECUX
t =
T
r =
    46
encoded_str =
Y
t =
h
r =
     8
encoded_str =
Yj
t =
E
r =
    31
encoded_str =
YjR
t =
r =
    53
encoded_str =
YjR
t =
q
r =
    17
encoded_str =
YjR w
t =
U
r =
    47
encoded_str =
YjR wI
t =
i
r =
     9
encoded_str =
YjR wIo
t =
C
r =
    29
encoded_str =
YjR wIoV
t =
k
r =
    11
encoded_str =
YjR wIoVl
t =
r =
    53
encoded_str =
YjR wIoVl
t =
B
r =
    28
encoded_str =
YjR wIoVl N
t =
r
r =
    18
encoded_str =
YjR wIoVl Nt
t =
O
r =
    41
encoded_str =
YjR wIoVl NtP
t =
w
r =
    23
encoded_str =
YjR wIoVl NtPe
t =
N
r =
    40
encoded_str =
YjR wIoVl NtPeM
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM
t =
f
r =
     6
encoded_str =
YjR wIoVl NtPeM g
t =
O
r =
    41
encoded_str =
YjR wIoVl NtPeM gP
t =
x
r =
    24
encoded_str =
YjR wIoVl NtPeM gPc
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM gPc
t =
J
r =
    36
encoded_str =
YjR wIoVl NtPeM gPc K
t =
u
r =
    21
encoded_str =
YjR wIoVl NtPeM gPc Ki
t =
M
r =
    39
encoded_str =
YjR wIoVl NtPeM gPc Ki<
t =
p
r =
    16
encoded_str =
YjR wIoVl NtPeM gPc Ki<[
t =
E
r =
    31
encoded_str =
YjR wIoVl NtPeM gPc Ki<[R
t =
d
r =
     4
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf
t =
O
r =
    41
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf P
t =
v
r =
    22
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf Pb
t =
E
r =
    31
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbR
t =
r
r =
    18
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt
t =
T
r =
    46
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt Y
t =
h
r =
     8
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt Yj
t =
E
r =
    31
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR
t =
l
r =
    12
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;
t =
A
r =
    27
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;S
t =
z
r =
    26
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;Sx
t =
Y
r =
    51
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU
t =
r =
    53
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU
t =
d
r =
     4
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU f
t =
O
r =
    41
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU fP
t =
g
r =
     7
encoded_str =
YjR wIoVl NtPeM gPc Ki<[Rf PbRt YjR ;SxU fPh
2
Pass
 
%%
s='abcdefghijklmnopqrstuvwxyz';
se='snvfrghjokl;,mp[wtdyibecux'; % a-z
assert(isequal(Qwerty_encode(s),se))
encoded_str =
     []
su =
snvfrghjokl;,mp[wtdyibecuxSNVFRGHJOKL:<MP{WTDYIBECUX
t =
a
r =
     1
encoded_str =
s
t =
b
r =
     2
encoded_str =
sn
t =
c
r =
     3
encoded_str =
snv
t =
d
r =
     4
encoded_str =
snvf
t =
e
r =
     5
encoded_str =
snvfr
t =
f
r =
     6
encoded_str =
snvfrg
t =
g
r =
     7
encoded_str =
snvfrgh
t =
h
r =
     8
encoded_str =
snvfrghj
t =
i
r =
     9
encoded_str =
snvfrghjo
t =
j
r =
    10
encoded_str =
snvfrghjok
t =
k
r =
    11
encoded_str =
snvfrghjokl
t =
l
r =
    12
encoded_str =
snvfrghjokl;
t =
m
r =
    13
encoded_str =
snvfrghjokl;,
t =
n
r =
    14
encoded_str =
snvfrghjokl;,m
t =
o
r =
    15
encoded_str =
snvfrghjokl;,mp
t =
p
r =
    16
encoded_str =
snvfrghjokl;,mp[
t =
q
r =
    17
encoded_str =
snvfrghjokl;,mp[w
t =
r
r =
    18
encoded_str =
snvfrghjokl;,mp[wt
t =
s
r =
    19
encoded_str =
snvfrghjokl;,mp[wtd
t =
t
r =
    20
encoded_str =
snvfrghjokl;,mp[wtdy
t =
u
r =
    21
encoded_str =
snvfrghjokl;,mp[wtdyi
t =
v
r =
    22
encoded_str =
snvfrghjokl;,mp[wtdyib
t =
w
r =
    23
encoded_str =
snvfrghjokl;,mp[wtdyibe
t =
x
r =
    24
encoded_str =
snvfrghjokl;,mp[wtdyibec
t =
y
r =
    25
encoded_str =
snvfrghjokl;,mp[wtdyibecu
t =
z
r =
    26
encoded_str =
snvfrghjokl;,mp[wtdyibecux
3
Pass
 
%%
s='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
se='SNVFRGHJOKL:<MP{WTDYIBECUX'; % A-Z
assert(isequal(Qwerty_encode(s),se))
encoded_str =
     []
su =
snvfrghjokl;,mp[wtdyibecuxSNVFRGHJOKL:<MP{WTDYIBECUX
t =
A
r =
    27
encoded_str =
S
t =
B
r =
    28
encoded_str =
SN
t =
C
r =
    29
encoded_str =
SNV
t =
D
r =
    30
encoded_str =
SNVF
t =
E
r =
    31
encoded_str =
SNVFR
t =
F
r =
    32
encoded_str =
SNVFRG
t =
G
r =
    33
encoded_str =
SNVFRGH
t =
H
r =
    34
encoded_str =
SNVFRGHJ
t =
I
r =
    35
encoded_str =
SNVFRGHJO
t =
J
r =
    36
encoded_str =
SNVFRGHJOK
t =
K
r =
    37
encoded_str =
SNVFRGHJOKL
t =
L
r =
    38
encoded_str =
SNVFRGHJOKL:
t =
M
r =
    39
encoded_str =
SNVFRGHJOKL:<
t =
N
r =
    40
encoded_str =
SNVFRGHJOKL:<M
t =
O
r =
    41
encoded_str =
SNVFRGHJOKL:<MP
t =
P
r =
    42
encoded_str =
SNVFRGHJOKL:<MP{
t =
Q
r =
    43
encoded_str =
SNVFRGHJOKL:<MP{W
t =
R
r =
    44
encoded_str =
SNVFRGHJOKL:<MP{WT
t =
S
r =
    45
encoded_str =
SNVFRGHJOKL:<MP{WTD
t =
T
r =
    46
encoded_str =
SNVFRGHJOKL:<MP{WTDY
t =
U
r =
    47
encoded_str =
SNVFRGHJOKL:<MP{WTDYI
t =
V
r =
    48
encoded_str =
SNVFRGHJOKL:<MP{WTDYIB
t =
W
r =
    49
encoded_str =
SNVFRGHJOKL:<MP{WTDYIBE
t =
X
r =
    50
encoded_str =
SNVFRGHJOKL:<MP{WTDYIBEC
t =
Y
r =
    51
encoded_str =
SNVFRGHJOKL:<MP{WTDYIBECU
t =
Z
r =
    52
encoded_str =
SNVFRGHJOKL:<MP{WTDYIBECUX
4
Fail
 
%%
s='You miss 100 percent of the shots you never take. Gretzky';
se='Upi ,odd 100 [rtvrmy pg yjr djpyd upi mrbrt yslr. Htryxlu';
assert(isequal(Qwerty_encode(s),se))
Error: Assertion failed.
5
Fail
 
%%
s='Those who believe in telekinetics raise my hand. Vonnegut';
se='Yjpdr ejp nr;orbr om yr;rlomryovd tsodr ,u jsmf. Bpmmrhiy';
assert(isequal(Qwerty_encode(s),se))
Error: Assertion failed.