def maxProfit(self, prices):
for i in range(len(prices)-1):
This is wrong. Try [1,2,3].
Edited: Its fine. Sorry my mistake :)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.