@greghogg5: CHEATING DEVELOPER vs Log n Engineer on Sqrt(x), Leetcode 69 #softwareengineering #softwaredevelopment #java #software #softwarejobs #softwareengineer #datastructures #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
Saturday 01 June 2024 12:31:08 GMT
65842
2135
61
37

Music

Download

Comments

jhayes_52
jack :
Use fast inverse square root
2024-06-01 20:26:34
58
akilmanivannan
Akil Manivannan :
Another approach is to notice there are only a small amount of perfect squares in the bound. You can binary search that list and get a slightly more efficient run-time, though same time complexit
2024-06-01 15:47:45
30
yquefueee_
yquefue :
Why not just loop from 1-x and check each square
2024-06-01 16:26:00
19
expandingsalad
Luca :
that’s the built in exponent operator :(
2024-06-02 01:39:39
7
aaaaaghsh
AAAAAGHSH :
If you know the maximum size of the integer you can just use a taylor series expansion to a certain precision
2024-06-01 19:32:57
3
pablamon
Pablamon :
When I read this I immediately thought of Taylor series. It might be a hassle to code though, especially if you have to write x*x*x… whenever you want to exponentiate
2024-06-01 15:53:02
2
perronazz
perronazz :
brute force for loop anyone 😆
2024-06-03 00:16:29
2
winstonfeet
W Inston :
does any body else feel like this kind of leetcode stuff is going to end up like those guys who do MS excel obstacle courses as in who cares
2024-06-01 22:42:49
2
danyatheory
danyatheory :
What class do u learn this in
2024-06-01 12:53:12
1
_._.._3_.._._
. :
id do a version of the fast inverse sqrt from quake but instead of inverse sqrt calculate the sqrt regularly, still likely faster to do sqrt instruction on the cpu
2024-06-03 06:59:35
1
cyfr0n_
cyfr0n_ :
Waiting for 6502 mnemonics :)
2024-07-27 22:56:16
0
cyfr0n_
cyfr0n_ :
quick draft C++ like: unsigned int sqrt(unsigned int x) { unsigned int s =0; while (squareIntager(s)<=x) { s++; } return(s-1) }
2024-07-27 22:53:12
0
normanaspx
Norman | 🌎 :
Gain time but sacrifices legibility
2024-07-29 23:16:43
0
greghogg5
Greg Hogg :
Thank you for watching the video! Follow me to see these in your feed daily, and be sure to check out the free goodies at the link in my bio :)
2024-06-01 12:31:42
0
timzz57
zaie❤️ :
@Zazatech_support Made me noticed my ex was cheating
2024-08-27 10:43:11
0
flyingfry3
Artur :
I‘ve seen the problem and most answers were just importing math and then using math.sqrt which is cheating lol
2024-06-13 13:35:28
0
wkorngod
wkorngod :
Just do a couple iterations of newtons method jfc
2024-06-06 05:31:21
0
raresanghel08
Rares :
what is the name of the site?
2024-06-05 21:07:52
0
mike.rey1
Mike Rey :
How about just exp(ln(x)/2) and then round?
2024-06-02 19:49:44
0
pseudonym1231001
Pseudonym :
why not the quake III alogrithm times x ?????
2024-06-01 17:57:02
0
idontevenknowkevin
kev :
This was dope! I first thought no way could I figure it out but you did it so easily and clearly
2024-06-01 17:24:30
0
physicsnick
nick :
I LOVE BINARY SEARCH 🔥🔥🔥
2024-06-01 16:05:53
0
To see more videos from user @greghogg5, please go to the Tikwm homepage.

Other Videos


About