Leetcode 456. 132 Pattern O(N) Solution

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • O(N) solution for
    leetcode.com/p...

Komentáře • 8

  • @abhijitroy1958
    @abhijitroy1958 Před 2 lety +1

    your logic was right and explanation was also good , but there were a little wrong in your code
    here my c++ code with your logic
    //class Solution {
    public:
    bool find132pattern(vector& nums) {
    if(nums.size()=0;i--){
    if(mini >nums[i])return true;

    while(!st.empty() and st.top()

  • @kunal_chand
    @kunal_chand Před 2 lety

    Best visual diargram for this question.

  • @SAUMILPatel2
    @SAUMILPatel2 Před 2 lety +1

    You have not traversed the array from last to first .

  • @tiger7858
    @tiger7858 Před rokem

    👎 for not traversing array from left to right while explaining

  • @kc8478
    @kc8478 Před 3 lety

    Does not work. Please dry run for array containing 132