Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the problem of picking up Rain Water by Java

Shulou Source: shulou.com Published: 2022-06-01 10:52:46 11月13日 Update

This article mainly introduces "how to solve the problem of connecting Rain Water with Java". In daily operation, I believe many people have doubts about how to solve the problem of connecting Rain Water with Java. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "how to solve the problem of connecting Rain Water with Java". Next, please follow the editor to study!

Int trap (vector& height) {int ans = 0, current = 0; stack st; while (current)

< height.size()) { while (!st.empty() && height[current] >

Height [st.top ()]) {int top = st.top (); st.pop (); if (st.empty ()) break; int distance = current-st.top ()-1; int bounded_height = min (height [current], height [st.top ()])-height [top]; ans + = distance * bounded_height } st.push (current++);} return ans;} at this point, the study on "how to solve the problem of picking up Rain Water by Java" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Questions Rain Water learning more help practical next articles methods theories knowledge articles websites materials follow easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn macOS Linux Shulou Tech Info