Skip to content

Commit

Permalink
User input part has been removed from previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
halderjoydeep committed Oct 4, 2018
1 parent 40523a6 commit 1c78fbe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions maximum_subarray/max_sub_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ def main():
# represents the day
# @param price_difference is array of profit(either +ve or -ve)

price = []
price_difference = []

for day in range(int(input('Total Days: '))):
price.append(int(input('Enter price: ')))
price = [4, 9, 5, 13, 16, 7, 8]

if len(price) <= 1:
print('Same day purchase and sell.So no profit.')
return

price_difference = []
for day in range(1, len(price)):
price_difference.append(price[day] - price[day - 1])

Expand Down

0 comments on commit 1c78fbe

Please sign in to comment.