Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON: The Diamond Cipher is an ingenious cipher that is used to encrypt ectangular tables of characters of size . The encryption process can
IN PYTHON:
The Diamond Cipher is an ingenious cipher that is used to encrypt ectangular tables of characters of size . The encryption process can described as follows: - First create a diamond out of the table's rows considering them one by one from top to bottom: - each row is written diagonally and goes from bottom to top and from left to right; - the row begins at the line of the diamond, counting from bottom to top (where means integer division); - each symbol of the row is written to the left of the symbols already present at that diamond line. - Then the diagonals of the diamond that go from bottom to top and from right to left are written down, which produces a new table. 'our task is to encrypt the given with the Diamond Cipher. Example For table=[[a,b,c],[d,e,f],[g,h,i],[j,k,1],[m,n,o],[p,q,I]] the output should be solution(table)=[[d,j,P],[a,g,m],[e,k,qu],[b,h,n],[f,1,I],[c,i,o]] with the following encryption process: abcdefghijk1mnopqrroqnlipmkhfcjgebdadjpagmekqbhnflrcio Input/Output - [execution time limit] 4 seconds (py3) - [input] array.array.char table A matrix of size for some integer each element of which is a lowercase English letter. Guaranteed constraints: - [output] array.array.char The encrypted
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started