Missing element in an Array

Consider a Array of N-1 elements which has values from 1 to N which means one of the element is always missing. So, In this Blog, sharing the code for the same.For Example a=( 4 3 2 5) , here number of elements is N-1 which means 4 and values ranges from 1 to N(which means 5) and hence we need to print that missing element or number is 1. arr=(4 3 2 5) ## Array of 4 elements(N-1)len_arr_1=$(( ${#arr[@]} +1)) ##Making length equal to N (5)len_arr=${#arr[@]} ## Traversing all…