We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I am getting the required Output in Debug output using Python 3, but still throws an error.
Any feedback is welcome. TIA
Pasting the code below:
#!/bin/python3importmathimportosimportrandomimportreimportsys## Complete the 'cutTheSticks' function below.## The function is expected to return an INTEGER_ARRAY.# The function accepts INTEGER_ARRAY arr as parameter.#defcutTheSticks(arr):# Write your code herelength=len(arr)forxinrange(length):iflen(arr)<1:breakmin_1=min(arr)print(len(arr))arr=[x-min_1forxinarr]arr=[dfordinarrifd>0]if__name__=='__main__':fptr=open(os.environ['OUTPUT_PATH'],'w')n=int(input().strip())arr=list(map(int,input().rstrip().split()))result=cutTheSticks(arr)
Cut the sticks
You are viewing a single comment's thread. Return to all comments →
I am getting the required Output in Debug output using Python 3, but still throws an error.
Any feedback is welcome. TIA
Pasting the code below: