Skip to content

Ready for LeetCode

Read · 1 of 3

LeetCode skips input() and print()

On LeetCode you fill in a method inside a class. LeetCode calls it with the input and checks what you return.

self is always the first parameter of a method; just leave it there. List[int] is only a note saying "a list of ints".

1class Solution:
2 def maxProfit(self, prices: List[int]) -> int:
3 # your code here