Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a python program in that read an integer list that contains set of positive numbers of size N. The maximum length of element in

image text in transcribed

Create a python program in that read an integer list that contains set of positive numbers of size "N". The maximum length of element in a list is based on the list size "N". For example if the list size is "6" then the maximum length of each element is "6", Le consider the array elements are [4365, 633, 262645, 48,7,54910](NOTE:Don't read the list elements in the form of strings/charact Create a function called "Recursive_Sum" that takes integer list as argument and calculate the recursive sum for the elements pre the list. For the above example, the first element is 4365, its sum is 4+3+6+5=18->1+8=9 (recursive sum: at last the recursive-su always gets only single digit number it may be any number between 1 and 9), likewise all the elements in the list, the recursive su be calculated. Hence, the newly formed list for the above example is [9,3,7,3,7,1]. Again, Calculate Final Sum (recursive sum) using another fund named "Final_Sum" for the elements currently present in the newly formed list. ie. 9+3+7+3+7+1=30->3+0=3. After finding out the "Final_Sum", in this case it is 3, now check whether the Final Sum (ie. 3) is exist in the each item in the input the Final Sum (ie. 3) is present then replace the element with 1 otherwise O. Hence our input list now becomes (1,1,0,0,0,0). Well-done, but your job is not yet over, convert this binary number [110000) to equivalent decimal number. ie. here it is 48. Yes, final result. ALL THE BEST. Input: 6 //array size 4365 633 262645 48 7 54910 Output 48

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago