{"type":"video","version":"1.0","html":"<iframe src=\"https://www.loom.com/embed/f024f5663110450399d54de3eccbfc04\" frameborder=\"0\" width=\"1244\" height=\"933\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>","height":933,"width":1244,"provider_name":"Loom","provider_url":"https://www.loom.com","thumbnail_height":933,"thumbnail_width":1244,"thumbnail_url":"https://cdn.loom.com/sessions/thumbnails/f024f5663110450399d54de3eccbfc04-80d486dab762b18f.gif","duration":300.1777,"title":"Maximizing Stock Trading Profits Using Sliding Window Technique","description":"In this video, I walk through the \"Best Time to Buy and Sell Stock\" problem from LeetCode, using a sliding window approach. I explain how to find the maximum profit by calculating the difference between the lowest and highest stock prices in a given array, with an example of prices: 10, 1, 5, 6, 7, and 1, which yields an output of 6. I detail the setup of left and right pointers and how to adjust them based on the conditions of the prices. The time complexity is O(n) and space complexity is O(1). I encourage viewers to follow along with the pseudocode and implement the solution themselves."}