Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT array = [ - 12 , - 11 , - 13 , - 5 , - 6 , 7 , 5 , 3 , 6 ] NEW_LINE length = len ( array ) NEW_LINE countNegative = 0 NEW_LINE for i in range ( length ) : NEW_LINE INDENT if ( array [ i ] < 0 ) : NEW_LINE INDENT countNegative += 1 NEW_LINE DEDENT DEDENT print ( " array : ▁ " , end = " " ) NEW_LINE printArray ( array , length ) NEW_LINE rearrange ( array , 0 , ( length - 1 ) ) NEW_LINE reverse ( array , countNegative , ( length - 1 ) ) NEW_LINE print ( " rearranged ▁ array : ▁ " , end = " " ) NEW_LINE printArray ( array , length ) NEW_LINE DEDENT