"
This is mostly correct and fairly fast.
My code has a bug somewhere where it fails on cases like the last case, where there are negative number on both ends of the array and the sums .
from collections import deque
debug = True # False
def prdbg(*x):
global debug
debug = True # False
if debug:
print(x)
else:
return
def max_sum(arr, start, end):
if type(arr) == type('''
"
Nathan B. - "
This is mostly correct and fairly fast.
My code has a bug somewhere where it fails on cases like the last case, where there are negative number on both ends of the array and the sums .
from collections import deque
debug = True # False
def prdbg(*x):
global debug
debug = True # False
if debug:
print(x)
else:
return
def max_sum(arr, start, end):
if type(arr) == type('''
"See full answer
"int a_array[10] = {3,6,4,7,2,1,9};
int index = 0;
int index2 = 0;
for ( index = 0; index < sizeof(a_array); index++ )
{
int tmpindex = index + 1;
if ( tmpindex <= sizeof(a_array) )
{
for ( index2 = tmpindex; index2 < sizeof(a_array); index2++ )
{
if ( aarray[index] <= aarray[index2] )
{
print( "%d is the NGE of %d" array[index2], array[index]);
break;
"
Mark S. - "int a_array[10] = {3,6,4,7,2,1,9};
int index = 0;
int index2 = 0;
for ( index = 0; index < sizeof(a_array); index++ )
{
int tmpindex = index + 1;
if ( tmpindex <= sizeof(a_array) )
{
for ( index2 = tmpindex; index2 < sizeof(a_array); index2++ )
{
if ( aarray[index] <= aarray[index2] )
{
print( "%d is the NGE of %d" array[index2], array[index]);
break;
"See full answer
Software Engineer
Data Structures & Algorithms
+1 more
🧠Want an expert answer to a question? Saving questions lets us know what content to make next.