for(int i=1; i<=a;i++){
for(int j=1;j<=b;j++){
if((i+j)%2 == 0){
count++;}}}
Can anyone reduce the Time complexity of this problem? I am finding great difficulty in doing it.
for(int i=1; i<=a;i++){
for(int j=1;j<=b;j++){
if((i+j)%2 == 0){
count++;}}}
Can anyone reduce the Time complexity of this problem? I am finding great difficulty in doing it.