Prog to find len of Longest AP