Code not giving correct output

@namangarg2000
hello Naman,
handle corner cases in your code.

i.e when li=0 then li-1 will be -1 or when lj==0 then lj-1 will be -1.
so handle these cases separately

@namangarg2000
refer this code - > https://ide.codingblocks.com/s/195084?_ga=2.204376087.626417516.1584426581-882484569.1584426581