1 real machine-learning interview question reported from Optiver.
You are given an integer array prices where prices i is the price of a given stock on the i-th day, and an integer k .…