+ 4

How can we minimize or decrease the speed of execution as well as memory occupied for the below code . Please help me in this.

https://code.sololearn.com/cK9Y4coaKoa1/?ref=app

9th Sep 2018, 1:44 AM
Ronald
2 Answers
+ 1
pettemsrikanthvarma other than vector approach mentioned by Tind , you can go with dynamic array as below: int a[100000] can be changed to int* a = new int [n]
9th Sep 2018, 6:41 AM
Ketan Lalcheta
Ketan Lalcheta - avatar