python code to read a array of numbers in a line code example
Example 1: how to take array input in python in single line
arr = list(map(int, input().split()))
Example 2: taking input of n integers in single line python in a list
arr = list(map(int, input().split()))