Whats wrong in the following code for rainwater harvesting

add this after declaring your arrays

arrl[0] = arr[0];
arrr[n - 1] = arr[n - 1];