Simplify code by dropping support for legacy Python (#1143)

* Simplify code by dropping support for legacy Python

* sort() --> sorted()
This commit is contained in:
Christian Clauss
2019-08-19 15:37:49 +02:00
committed by GitHub
parent 32aa7ff081
commit 47a9ea2b0b
145 changed files with 367 additions and 976 deletions

View File

@ -1,6 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
from .stack import Stack
__author__ = 'Omkar Pathak'

View File

@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import absolute_import
import string
from .stack import Stack

View File

@ -1,17 +1,16 @@
from __future__ import print_function
# Function to print element and NGE pair for all elements of list
def printNGE(arr):
for i in range(0, len(arr), 1):
next = -1
for j in range(i+1, len(arr), 1):
if arr[i] < arr[j]:
next = arr[j]
break
print(str(arr[i]) + " -- " + str(next))
# Driver program to test above function
arr = [11,13,21,3]
printNGE(arr)

View File

@ -1,4 +1,3 @@
from __future__ import print_function
__author__ = 'Omkar Pathak'

View File

@ -6,7 +6,6 @@ The span Si of the stock's price on a given day i is defined as the maximum
number of consecutive days just before the given day, for which the price of the stock
on the current day is less than or equal to its price on the given day.
'''
from __future__ import print_function
def calculateSpan(price, S):
n = len(price)