Taking max element present in either array
m = arr1 [ - 1 ] NEW_LINE n = arr2 [ - 1 ] NEW_LINE ans = 0 NEW_LINE if m > n : NEW_LINE INDENT ans = m NEW_LINE DEDENT else : NEW_LINE INDENT ans = n NEW_LINE DEDENT