IDFC FIRST Bank interview question

Round 2: Write a java code for the best time to buy and sell stocks (leetcode question)