-
1 Comment
Zunaed Kibria
on 16 Mar 2020
Why this code is doesnt pass though it gives me proper ans in matlab
in = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890;,.!& '
out = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm1234567890;,.!& '
s2 = s1
for i=1:length(s1)
x= find(in == s1(i)) ;
s2(i) = out(x)
end
specialcase = find(s2 == '&')
if ~isempty(specialcase)
s2(specialcase)='<'
s2(specialcase+1:specialcase+3)=[]
end
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!