- 112
- 121 398
Santamaria Code
United States
เข้าร่วมเมื่อ 8 ก.ย. 2019
My goal of this channel is to help others, as well as to research interesting software development topics.
LeetCode 11 Container With Most Water | JavaScript Two Pointers
JavaScript Two Pointer Solution
มุมมอง: 71
วีดีโอ
Leetcode 451. Sort Characters By Frequency | JavaScript | Hash Table
มุมมอง 223ปีที่แล้ว
JavaScript Hash Table Solution
LeetCode 347 Top K Frequent Elements | JavaScript Hash Table
มุมมอง 1.4Kปีที่แล้ว
JavaScript Hash Table Solution
Leetcode 2260 Minimum Consecutive Cards to Pick Up JavaScript Hashmap and Sliding Window
มุมมอง 41ปีที่แล้ว
Leetcode 2260 Minimum Consecutive Cards to Pick Up JavaScript Hashmap and Sliding Window
Longest Substring Without Repeating Characters LeetCode JavaScript Hashmap and Sliding Window
มุมมอง 130ปีที่แล้ว
Longest Substring Without Repeating Characters LeetCode JavaScript Hashmap and Sliding Window
Group Anagrams LeetCode 49 JavaScript Hash Map
มุมมอง 237ปีที่แล้ว
Group Anagrams LeetCode 49 JavaScript Hash Map
Maximum Number of Balloons LeetCode 1189 JavaScript Hashmap
มุมมอง 146ปีที่แล้ว
Maximum Number of Balloons LeetCode 1189 JavaScript Hashmap
LeetCode 58 Length of Last Word JavaScript
มุมมอง 544ปีที่แล้ว
LeetCode 58 Length of Last Word JavaScript
Two Sum LeetCode JavaScript | Hashmap Solution
มุมมอง 567ปีที่แล้ว
Two Sum LeetCode JavaScript | Hashmap Solution
Valid Palindrome LeetCode JavaScript with Two Pointers
มุมมอง 303ปีที่แล้ว
Valid Palindrome LeetCode JavaScript with Two Pointers
Longest Consecutive Sequence LeetCode JavaScript
มุมมอง 503ปีที่แล้ว
I walk thru this excellent solution here, credit to the original author of this solution: leetcode.com/problems/longest-consecutive-sequence/solutions/139940/simple-javascript-o-n-solution/?orderBy=most_votes&languageTags=javascript
Maximum Matching of Players With Trainers LeetCode JavaScript Two Pointers
มุมมอง 46ปีที่แล้ว
LeetCode JavaScript Two Pointers solution
771 Jewels and Stones LeetCode JavaScript Hash Table
มุมมอง 208ปีที่แล้ว
771 Jewels and Stones LeetCode JavaScript Hash Table
Minimize Maximum Pair Sum in Array 1877 LeetCode JavaScript Two Pointer Solution
มุมมอง 107ปีที่แล้ว
Minimize Maximum Pair Sum in Array 1877 LeetCode JavaScript Two Pointer Solution
445 Assign Cookies LeetCode JavaScript Two Pointer
มุมมอง 103ปีที่แล้ว
445 Assign Cookies LeetCode JavaScript Two Pointer
2248 Intersection of Multiple Arrays LeetCode JavaScript Hashmap
มุมมอง 142ปีที่แล้ว
2248 Intersection of Multiple Arrays LeetCode JavaScript Hashmap
LeetCode 1876. Substrings of Size Three with Distinct Characters JavaScript Sliding Window
มุมมอง 509ปีที่แล้ว
LeetCode 1876. Substrings of Size Three with Distinct Characters JavaScript Sliding Window
LeetCode 1614 Maximum Nesting Depth of the Parentheses JavaScript | Stack Solution
มุมมอง 168ปีที่แล้ว
LeetCode 1614 Maximum Nesting Depth of the Parentheses JavaScript | Stack Solution
Max Consecutive Ones JavaScript LeetCode 485 Sliding Window
มุมมอง 224ปีที่แล้ว
Max Consecutive Ones JavaScript LeetCode 485 Sliding Window
Maximum Average Subarray I LeetCode 643 JavaScript
มุมมอง 243ปีที่แล้ว
Maximum Average Subarray I LeetCode 643 JavaScript
Number of Sub arrays of Size K and Average Greater than or Equal to Threshold LeetCode JavaScript
มุมมอง 38ปีที่แล้ว
Number of Sub arrays of Size K and Average Greater than or Equal to Threshold LeetCode JavaScript
LeetCode Reverse Prefix of Word | LeetCode 2000 | JavaScript Sliding Window
มุมมอง 122ปีที่แล้ว
LeetCode Reverse Prefix of Word | LeetCode 2000 | JavaScript Sliding Window
Consecutive Characters | LeetCode 1446 | JavaScript
มุมมอง 101ปีที่แล้ว
Consecutive Characters | LeetCode 1446 | JavaScript
LeetCode JavaScript Longer Contiguous Segments of Ones than Zeros | 1869
มุมมอง 23ปีที่แล้ว
LeetCode JavaScript Longer Contiguous Segments of Ones than Zeros | 1869
Leetcode 1089 Duplicate Zeros | Javascript
มุมมอง 589ปีที่แล้ว
Leetcode 1089 Duplicate Zeros | Javascript
Leetcode 1768. Merge Strings Alternately | JavaScript | Two Pointers
มุมมอง 1.2Kปีที่แล้ว
Leetcode 1768. Merge Strings Alternately | JavaScript | Two Pointers
Reverse Only Letters LeetCode 917 | Two Pointers | JavaScript
มุมมอง 218ปีที่แล้ว
Reverse Only Letters LeetCode 917 | Two Pointers | JavaScript
Leetcode 345 Reverse Vowels of a String in JavaScript
มุมมอง 330ปีที่แล้ว
Leetcode 345 Reverse Vowels of a String in JavaScript
Check if the Sentence Is Pangram LeetCode 1832 | Javascript
มุมมอง 5332 ปีที่แล้ว
Check if the Sentence Is Pangram LeetCode 1832 | Javascript
Great solution using JS. Thank you so much.
var topKFrequent = function (nums, k) { //create hash object to store instances let numsHash = {}; for (let i = 0; i < nums.length; i++) { numsHash[nums[i]] = (numsHash[nums[i]] || 0) + 1; } let sortedKeys = Object.keys(numsHash) .sort((a, b) => numsHash[b] - numsHash[a]) .map((key) => Number(key)); return sortedKeys.splice(0, k); }; I did it this way which is a summated version of yours however the problem says to try and do it under O(nLogn). Our solutions are O(nLogn)
Thank you!!
lol what your viewer should do when facing a problems with ts modules or importing files no visible
Immediate rejection in any interview with that while loop
The explanation is vague but the solution is correct. I recommend writing out the solution as provided by the video and sticking it into ChatGPT with a prompt along the lines of "explain line by line".
Thanks!
Is it ever have been working? It's o(n^2) solution, it gives TLE on leetcode
clear and direct explanation, thanks
This definitely seems like a more reasonable solution in a 25 min interview. Other answers I've seen are more performant, but I don't think most people would ever think of them that quickly!
Yeah, I usually go with a map or a plain ol object. The solution I saw on neetcode was an Array of empty arrays, where the length was the nums length +1. By dropping the count in array buckets, you don’t have to sort
nice one mate
Nice
super simple and well explained!
3:27 - "We are going to do some logic here" great explanation :)
thanks very useful!
great explanation!
Thanks, very clear explanation
thanks a lot i have been searching for the solution for past 1 hour which is easy to understand , really helped me a lot you deserve a subsribe I hope you have a good day Love from India
1st
thanks
thank you
Thank you!
I really dont know what the f Im doing wrong, this basically is the standard solution, everywhere I look, it's basically the same code..... I can write it down by my own or I can just copy and paste, but It doesn't return the expected output.... I understand clearly what the code is doing, but the output I recieve it's not the expected.... Im actually tired to look at this simple thing, understand it, even copy and paste, but ????
var duplicateZeros = function(arr) { for(let i=0;i<arr.length-1;i++){ if(arr[i]===0){ for(let j=arr.length-1;j>i;j--){ arr[j]=arr[j-1] } i++ } } return arr }; this is the working soultion the video above is incorrect
great logic
Leetcode is the dumbbest goddamn thing ever. God I hate leetcode
This is not correct. It should be solved using Floyd's Cycle Detection algorithm
Thanks a lot!
where are we using stack here?? and why is depth = max of count and depth (i am not able to understand this part)
Exactly what I needed thanks!
weak explaining
Thank!
It shouldnt be converted to string did you read the problem
You mean "Follow up: Could you solve it without converting the integer to a string?" var isPalindrome = function(x) { if(x < 0) return false; let copy = x; let reversed = 0; while (copy !== 0){ reversed = reversed * 10 + copy%10; copy = Math.floor(copy/10); } if (reversed === x){ return true; } return false; };
@@WTHalo3 can you explain ?
@@TienNguyen-og5eo The line reversed = reversed * 10 + copy%10; takes the remainder of copy (which is x) when you modulus 10 it. Meaning if I had a number 456%10 = 6. That gets pushed to reversed so reversed is = 6. Then copy = Math.floor(copy/10); removes the last digit so 456 becomes 45. THen it goes again reversed = 6 * 10 + 45%10 = 65 copy = 4 reversed = 654 copy = 0 loop is done. Not a palindrome number so returns false.
@@WTHalo3 thank. I guess this is the best way in case converting to string is not allowed ?
Good explanation, but if I understand correct the shift method does not take any arguments.
finally i understand it
ididn't think of the array wow thank u
Great video! Here are my thoughts on time and space complexity for this solution: Time Complexity: O(n + m) - Loop through nums1 and nums2 array once. Space Complexity: O(n + m) - worst case is nums1 and nums2 has the exact same values.
I dont understand, leetcode say in this exercise "Follow up: Could you solve it without converting the integer to a string?" and you are convert the integer to a string. This right?
very helpful, thanks!
NIce and excellent explanation! thank you so much
Why did you call your video 'Mixin in Vue 3 ' if you are using vue 2 syntax?
Thanks a lot
HOW TO DECOMPRESS A STRING IN JS..IF YOU ALREADY MADE THE VIDEO PLS SHARE LINK
wtf was that, awful explanation
great! what does !obj means??
object
Thanks for the video.
Thanks a lot, very informative and concise. You deserve way more subscribers! I suggest you work on your thumbnails. Thanks again!
good examples, thank you for sharing this with us.
You really did effort to explain. Subscribed!!!
thanks for a solution that's easy to understand :)
This is incorrect. The rule is to use constant space, and O(n) time.