English, asked by pravalikakommera, 6 months ago

The company Digital Secure Data Transfer
Solutions provides data encryption and data
sharing services. Their process uses a key K for
encryption when transmitting a number. To
encrypt a number, each digit in the number is
replaced by the Kth digit after it in the number.
The series of digits is considered in a cyclic
fashion for the last K digits. program in python​

Answers

Answered by barmansuraj489
0

Answer:

Python is a powerful, high-level, expressed programming language. Code legibility is prioritized in its design concept, which makes heavy use of indentation. Python uses garbage collection and dynamic typing.

Explanation:

We have to write this process in python.

A question regarding to this has been given to us.

Question The company Digital Secure Data Transfer Solutions provides data encryption and data sharing services. The process uses a key for encryption when transmitting a list of elements. To encrypt the list of elements, each element in the list is replaced by the sum of odd elements from the next/previous K elements in the list. If the value of K is positive then the previous k elements in the list are selected. If the value of K is negative, then the next k elements in the list are selected. The series of elements is considered in a cyclic fashion for the last K elements. If no odd element in the next/previous k elements is found then the element is replaced with a zero. Write an algorithm to find the encrypted list. Input The first line of the input consists of two space-separated integers - size and key, representing the size of the list (N) and the key(K), respectively. The second line consists of N space-separated integers - arr(1), arr(2),..., arr[N]. representing the elements of the list. Output Print N space-separated integers representing the encrypted list. Constraints0 < size s 105 -106 s arrus 106  1 sis size Example Input: 43 42-5 11 Output: 6 6 11-5.

Final answer:

So, I have written the answer of the question and this is our final answer also.

#SPJ3

Answered by rathodpraveen622
1

Answer: Python Solution:-

def rotation(keys,array):

   return array[-keys+1:]+array[:-keys+1]

keys=3

num=25143

array=res = [int(x) for x in str(num)]

result=rotation(keys,array)

res= int("".join(map(str, result)))

print(str(res))

Explanation:

step1:- convert the digit into list format

step2:- rotate the list with the key value

step3:-finding the rotation of list using recursion

step4:- Finally Result is converted into the List to normal digit format

Input:- key=3

          digit=25143

output:-43251

         

Similar questions