Ayaz SomaniRajesh - if your solution has to process an array of 40 elements where all values are equal to the…Here's another way to solve the problem that only requires passing each element of the array exactly once. (See gist…Dec 7, 20211Dec 7, 20211