LeetCode Problem: 217. Contains Duplicate | Java Solution

  Рет қаралды 8,499

Code for Interview

Code for Interview

Күн бұрын

Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
leetcode.com/p...
Find the complete playlist of LeetCode Problems
• LeetCode Problem: 709....
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
Do checkout other videos
Java Projects Playlist: • 1/12 - Bank Management...
JavaScript Projects Playlist: • JavaScript Projects
React Projects Playlist: • React Projects
MERN Stack Projects Playlist: • MERN Stack Projects
Spring Boot Full Stack Projects: • Full Stack Projects - ...
Next.js Projects Playlist: • Next.js Projects
Follow Us
Instagram: codeforinterview ( / codeforinterview )
Telegram: codeforinterview (t.me/codeforin...)

Пікірлер: 21
@codeforinterview
@codeforinterview Жыл бұрын
There is a slight mistake in Brute Force Approach in the video, Please refer below solution for (int i = 0 ; i < nums.length - 1; i++) { // It should go till second last element for (int j = i + 1; j < nums.length ; j++ ) { // We should check the condition with j and increment j, not i if (nums[i] == nums[j]) { return true; } } } return false; If you have a better solution, do comment. and check out the whole playlist of Leetcode questions kzbin.info/www/bejne/mYC1fGOPeriab6M
@vanshmodi14
@vanshmodi14 Жыл бұрын
After knowing the mistake in the video than correcting it in comment box is very rare not everyone do that, we need teachers like you😃😃.
@codeforinterview
@codeforinterview Жыл бұрын
🙌🙌
@anuragsuryawanshi4177
@anuragsuryawanshi4177 2 жыл бұрын
Sir, you are amazing I recently started learning DSA in java and for this question I couldn't think beyond brute-force solution, but you explained every solution in a very simplistic manner Please keep making such amazing lectures
@codeforinterview
@codeforinterview Жыл бұрын
thankyou so much 🙌
@anandkumarnitrourkela7404
@anandkumarnitrourkela7404 Жыл бұрын
Great explaination.Keep uploading more such videos.
@codeforinterview
@codeforinterview Жыл бұрын
Thank you, I will
@sanchitsingh6942
@sanchitsingh6942 2 жыл бұрын
Bhaiya agr hume element mil jaye toh return true krke break lga do hume aage again check krne ki zaroorat nhi hai. Thankyou for this .Please Never stop this leetcode series😀
@codeforinterview
@codeforinterview Жыл бұрын
thanks for your comment, one thing to note is return will work like a break statement because if the element is found, it will return the function and will not check any further.
@mansigoyal9664
@mansigoyal9664 2 жыл бұрын
Great explaination sir, you are always the besttt. Big fan of you sirrrrrrr👏👏💯💯
@codeforinterview
@codeforinterview 2 жыл бұрын
Thank you so much 😀
@akshaykumar192
@akshaykumar192 Жыл бұрын
arrays.sort(nums) karne par undeclared identifier kyu bata raha hai ?
@codeforinterview
@codeforinterview Жыл бұрын
I am not sure, I am not able to replicate the same
@your_anonymous454
@your_anonymous454 3 ай бұрын
sir can we use this sort method directly in interview as well?
@AnasAnsari-xo8bc
@AnasAnsari-xo8bc 2 жыл бұрын
Bhadia sir Video banate rahiya
@codeforinterview
@codeforinterview 2 жыл бұрын
Thank you so much 😀
@videshpundir34
@videshpundir34 2 жыл бұрын
Thank you so much..
@codeforinterview
@codeforinterview 2 жыл бұрын
You're most welcome
@suryas8407
@suryas8407 9 ай бұрын
Thank You
@codeforinterview
@codeforinterview 9 ай бұрын
welcome. please find the whole playlist here kzbin.info/www/bejne/mYC1fGOPeriab6M
@anoopshetty3580
@anoopshetty3580 9 ай бұрын
let mySet = new Set(nums) let bool = false if(nums.length!=mySet.size) { bool=true } return bool }; how is my code
LeetCode Problem: 344. Reverse String | Java Solution
10:44
Code for Interview
Рет қаралды 6 М.
Contains Duplicate - Leetcode 217 - Python
6:31
NeetCode
Рет қаралды 695 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
LeetCode Problem: 121. Best Time to Buy and Sell Stock | Java Solution
11:10
Минимум математики для Айтишников
16:12
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 81 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 847 М.
LeetCode Problem: 709. To Lower Case | Java Solution
22:07
Code for Interview
Рет қаралды 36 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН