https://locaakj.blogspot.com/2023/01/how-to-find-local-max-and-min-on-graph.html
How To Find Local Max And Min On A Graph