Write a program to compute the length of longest nondecreasing subsequence in a given array of
integers. The following is the way we formulated to compute the length at position j.
use the data
If Array indices start from 0.
Initialization: len[0]=1;len[j]=1 for all j
Computation: to calculate len[j]
for (i=0;i<j;i++)
if (a[i] ≤ a[j])
if (len[j] < len[i]+1)
len[j]=len[i]+1