From f1cf79202768cc862155ff8928320fc7b050bd72 Mon Sep 17 00:00:00 2001 From: Akash Soni <42613224+akashiitd@users.noreply.github.com> Date: Thu, 29 Nov 2018 18:19:17 +0530 Subject: [PATCH] Create Array Manipulation(List Max) --- Array Manipulation(List Max) | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Array Manipulation(List Max) diff --git a/Array Manipulation(List Max) b/Array Manipulation(List Max) new file mode 100644 index 0000000..4eb7bda --- /dev/null +++ b/Array Manipulation(List Max) @@ -0,0 +1,45 @@ +#!/bin/python3 + +import math +import os +import random +import re +import sys + +# Complete the arrayManipulation function below. +def arrayManipulation(n, queries): + list = [0]*(n+1) + for i in queries: + x, y, incr = i[0],i[1],i[2] + list[x-1] += incr + if((y)<=len(list)): list[y] -= incr; + max = x = 0 + for i in list: + + x=x+i; + if(max