Find the Prefix Common Array of Two Arrays | Leetcode 2657

  Рет қаралды 2,876

Techdose

Techdose

Күн бұрын

Пікірлер: 30
@sailendrachettri8521
@sailendrachettri8521 8 күн бұрын
Thank you sir :)
@techdose4u
@techdose4u 8 күн бұрын
Most welcome!
@vinayreddyBora
@vinayreddyBora 8 күн бұрын
thank you sir...
@techdose4u
@techdose4u 8 күн бұрын
welcome
@nagendravinayravisetti-jc6yv
@nagendravinayravisetti-jc6yv 8 күн бұрын
Thanks
@techdose4u
@techdose4u 8 күн бұрын
welcome
@devmahad
@devmahad 8 күн бұрын
thanks :)
@techdose4u
@techdose4u 8 күн бұрын
welcome back :)
@LawZist
@LawZist 8 күн бұрын
What if we will use 2 sets for each array and for each element we will check the set of the other array while maintaining a counter?
@techdose4u
@techdose4u 8 күн бұрын
But why 2 sets ? Prefix means it should be present in both. So, if you check 1 its enough :)
@RajSingh-r9r4l
@RajSingh-r9r4l 8 күн бұрын
Where it is mentioned that each element can occur atmost one times?
@techdose4u
@techdose4u 8 күн бұрын
in the problem statement
@yelugulavenkatanagaprathap-k5u
@yelugulavenkatanagaprathap-k5u 8 күн бұрын
Thanks Sir..How to decide like need to take UnOrdered set / Frequency while attempting this problem.?
@techdose4u
@techdose4u 8 күн бұрын
Set was good enough unless the size was 10^5 :)
@Dineshkumar_dk
@Dineshkumar_dk 8 күн бұрын
time complexity of "in" operation in set also O(n) for worst case.
@techdose4u
@techdose4u 8 күн бұрын
log N for set N for unordered set
@RajSingh-r9r4l
@RajSingh-r9r4l 8 күн бұрын
​@@techdose4u I guess you said opposite
@techdose4u
@techdose4u 8 күн бұрын
Ordered set is “set” with logN all operations Unordered set has different implementation with O(N) complexity but Theta(1) avg time.
@yelugulavenkatanagaprathap-k5u
@yelugulavenkatanagaprathap-k5u 8 күн бұрын
Hi Sir, This problem comes under Greedy approach ?
@techdose4u
@techdose4u 8 күн бұрын
Greedy because you can determine answer without trying all possibilities or looking at future items. So YES
@wierdo9514
@wierdo9514 8 күн бұрын
I did hashing 🙂
@techdose4u
@techdose4u 8 күн бұрын
nice
@thrillmantra
@thrillmantra 8 күн бұрын
can u pls explain zeros and ones dp problem pls
@techdose4u
@techdose4u 8 күн бұрын
From leetcode ?
@mukulgupta7251
@mukulgupta7251 8 күн бұрын
First viewer
@techdose4u
@techdose4u 8 күн бұрын
nice :)
@NikitaKanchan-q3l
@NikitaKanchan-q3l 8 күн бұрын
Hello sir, I have google phone screen kindly guide me what can i expect and focus
@techdose4u
@techdose4u 8 күн бұрын
You can ping us on whatsapp and ask the same question directly
Check if a Parentheses String Can Be Valid | Leetcode 2116
25:49
Map of Highest Peak | Leetcode 1765
15:19
Techdose
Рет қаралды 3,8 М.
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
I'VE MADE A CUTE FLYING LOLLIPOP FOR MY KID #SHORTS
0:48
A Plus School
Рет қаралды 20 МЛН
Trapping Rain Water II | Leetcode 407
31:10
Techdose
Рет қаралды 7 М.
"BEST C++ CODE ever written" // Code Review
27:38
The Cherno
Рет қаралды 113 М.
DAY 9 || Doing Leetcode daily until I get a job
41:03
Product of array except self | Leetcode #238
15:00
Techdose
Рет қаралды 98 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 801 М.
Grid Game | Leetcode 2017
21:51
Techdose
Рет қаралды 7 М.
Prefix Sums and Difference Array: 20 minutes of EVERYTHING you need to know
20:00
Competitive Programming with Shayan
Рет қаралды 4 М.
Bitwise XOR of All Pairings | Leetcode 2425
11:48
Techdose
Рет қаралды 3,1 М.
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН