@greghogg5: Split the Array - Leetcode 3046 #softwareengineering #softwaredevelopment #java #software #softwarejobs #datastructures #softwareengineer #leetcode #programming #javadeveloper #datastructuresandalgorithms #python #softwaredeveloper #code #FAANG #coding #javascript #javascriptdeveloper #codingisfun #codinginterview #js #html #css #sql

Greg Hogg
Greg Hogg
Open In TikTok:
Region: CA
Wednesday 16 October 2024 15:00:00 GMT
84765
3511
39
64

Music

Download

Comments

blentyy_
blentyy_ :
If the input is sorted then you’re using O(n) space which is unnecessary, as you could use two pointers and a single pass
2024-10-16 16:26:07
35
vncntwww_
Vincent 🇺🇸 :
Your audio only plays on the left EarPod on headphones.
2024-10-18 03:51:30
25
maxxxedoutmax
Max :
It is Visa… this is about as hard as it gets for them. If you can string Hello World together without getting mixed up you can blow away most of their interviewers.
2024-10-17 06:21:23
35
klaksun
махем :
hashmaps.
2024-10-18 23:01:42
0
biggermoose
Bigger Moose :
if input is sorted, just have a counter checking if there are more than 2 occurrences in a row
2024-10-22 04:13:10
0
joshuakoudys
Joshua Koudys :
nice time to use expressions over statements. return all(v <= 2 for v in Counter(nums).values()) 0ms one-liner
2024-12-02 17:52:03
2
bokchoi36
user2538017214964 :
Can you do 416 ? Seems similar but I can’t figure it out
2024-10-21 04:37:00
0
jimhalpert314
Jim Halpert314 :
You also need to make sure the number of elements is even.
2024-12-20 12:52:43
0
melatone
Brandyn :
At my Amazon code interview i did something like this and thought it was hella unoptimized. I cooked apparently
2024-10-17 19:55:06
1
a2axphoenix
A2AxPhoenix :
Hashmaps simple as
2024-10-22 07:50:28
0
nick_____t
Nick :
might be much faster on larger inputs to check if the count is >2 after processing each element, so we can return early
2024-10-18 00:36:26
0
gavkocz
gavkoCZ :
instead of a dict, just make a counter that restets for on a different number. Safes a lot of memory and hashing overhead
2024-11-03 09:16:51
0
jc_barrios_81
JC_Barrios_81 :
Thanks!!?
2024-10-16 15:27:34
1
aaron_abrham
Ruth :
I didn't why your explanation always stick in my minds. Anyway 🙏🙏🙏🙏🙏
2024-10-16 21:14:27
0
functor42
Functor :
Although the question has a simple answer, some people might jump straight to an array solution without thinking a little more and seeing the frequency solution.
2024-10-17 08:07:44
1
mattraxxer
mattraxxer :
Something went wrong with the sound
2024-10-16 15:30:00
4
greghogg5
Greg Hogg :
Master data structures and algorithms for FREE at AlgoMap.io :)
2024-10-16 15:28:16
0
chillszz
Chillsz :
when in doubt use hashmaps
2024-10-17 04:16:13
1
To see more videos from user @greghogg5, please go to the Tikwm homepage.

Other Videos


About