962. Maximum Width Ramp | stacks | Leetcode Daily Challenge | DSA | Java | shashcode

preview_player
Показать описание
Monotonic Stack Pattern and Questions

Problem Name:
962. Maximum Width Ramp

Problem Statement:
A ramp in an integer array nums is a pair (i, j) for which i j and nums[i] = nums[j]. The width of such a ramp is j - i.

Given an integer array nums, return the maximum width of a ramp in nums. If there is no ramp in nums, return 0.

Problem Link:

Solution Link:

Graph Playlist:

Java Plus DSA Placement Course Playlist:

Java Plus DSA Sheet:

Notes:

Telegram Link:

Ultimate Recursion Series Playlist:

Samsung Interview Experience:

Company Tags:
Facebook | Amazon | Microsoft | Netflix | Google | LinkedIn | Pega Systems | VMware | Adobe | Samsung

Timestamp:
0:00 - Introduction

#ShashwatTiwari #coding​​ #problemsolving​
Рекомендации по теме
Комментарии
Автор

Please upload all leetcode questions. Ur video explanation is good

charuagarwal
Автор

hey, monotonic pattern kafi tricky hota hai, description me maine videos add krdi hai, woh bhi dekh lena... not same but help ho jaege, aur ache se smjh aa jaega... Like target is 130, please do like if you have understood the explanation 😄😄

shashwat_tiwari_st
Автор

solved this problem, only 2 test cases are getting failed.

aakashdeep_
Автор

Sir DP series kab start karenge app please reply ❤

mr.nishantawasthi
Автор

Bhaiya ek request hai..please jab aap video upload krte ho toh.. title mai approach mt likha kro(stack)..mai problem pehle khudse try krta hu without any hint but YT notification se mujhe video title dikh jata hai aur hint mila jata hai😢

сойка-ий
Автор

how someone think this approch is it always true

niteshkhanna
Автор

Thanks bhaiya got it..but 3 bar dekhna para

DarkDragon-bzqp
Автор

Hi
Can u please make a video for leetcode 1590

khushalgandhi
Автор

can you also show a way where this can be solve even better using binary search?
please...

vipulbhavsar
Автор

sir will help to solve this question

Given a string `s` and an integer `k`, find the number of substrings of `s` where the frequency of each character in the substring is equal to `k`.

Constraints

1 <= n, k <= 10^5`
s` contains digits from 0 to 9
Example :

`n = 7`, `k = 2`, `s = "1102021"`
Output : 4

Substrings with equal frequency of 2:

* "11"
* "110202"
* "0202"
* "102021"

biplab
Автор

Solve bruteforce but not understand how i solve optimize problem

MohammedHasmi
Автор

thankyou bhaiya 😇😇 waise apne kal ka aur perso ka problem bhaut pehle padhaya tha maine khud se kr liya tha😛

PiyushSharma-weyd
Автор

Brute Froce : 🫡
class Solution {
public int maxWidthRamp(int[] nums) {

int maxDis = 0;

for(int i = 0;i<nums.length;i++){
for(int j = nums.length -1;j>0;j--){
if(nums[j]>= nums[i]){
int currDis = j-i;
maxDis = Math.max(maxDis, currDis);
}
}
}
return maxDis;
}
}

is_Debu
welcome to shbcf.ru