LeetCode Problem: 34. Find First and Last Position of Element in Sorted Array | Java Solution

preview_player
Показать описание
Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.

🎥 Complete playlist of LeetCode Problems

---------------------------------------------------------------------------------------------

Checkout other videos

🌎 Find Me Here:

#leetcode #leetcodesolution #leetcodequestionandanswers
Рекомендации по теме
Комментарии
Автор

Why have you used high = nums.length in the second loop? 🤔

zakkyA
Автор

Can you help me on creating react app with mui? I am getting errors..

prismstealthx
Автор

My error is-
Maximum update depth exceeded. This can happen when a component calls setState inside useEffect,
but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render

this code is from whatsapp clone 8/8

useEffect(()=>{ socket.current.emit('addUsers', account);
socket.current.on('getUsers', users=>{
setActiveUser(users)
})
}, [account])


plz solve

pkm
Автор

cannot Find symbol in conn c= new conn() Main error aa rhi hai, please help

yuvrajyadav
Автор

please make a video on whatsapp deployment

sachinpandey
Автор

better :

class Solution {
public int[] searchRange(int[] nums, int target) {
int first = -1;
int last = -1;
if(nums.length == 0) return new int[] {-1, -1};
for (int i = 0; i < nums.length; i++) {
if (nums[i] == target) {
if (first == -1) {
first = i;
}
last = i;
}
}

if (first != -1) {
return new int[]{first, last};
}
return new int[]{-1, -1};
}
}

KAUSHIK-lhlw
Автор

Sir pls make react native videos , it's a request sir

anmolmishra