Skip to content

Ready for LeetCode

Read · 1 of 3

LeetCode skips input and output

On LeetCode you fill in one function. LeetCode calls it with the input and checks what you return. No reading input, no console.log.

The comments above it (@param {number[]} prices) just tell you the types: number[] means an array of numbers.

1/**
2 * @param {number[]} prices
3 * @return {number}
4 */
5var maxProfit = function (prices) {
6 // your code here
7};