How to Solve Programming Problems Like a Pro

  Рет қаралды 556

The Coding Lion

The Coding Lion

Күн бұрын

Пікірлер: 14
@thecodinglion
@thecodinglion 2 күн бұрын
Access our free newsletter: thecodinglion.beehiiv.com
@FoXcodeZ
@FoXcodeZ 15 күн бұрын
Optimization: The for loop inside the isPrime function doesn't need to iterate over even numbers, as all prime numbers (except 2) are odd.
@the_daily_improvement
@the_daily_improvement 15 күн бұрын
I am not really good at programming but i don't think this solution will optimize thee problem. Nice try by the way.
@thecodinglion
@thecodinglion 15 күн бұрын
Nice try. But it is still not optimized
@E.N77
@E.N77 2 күн бұрын
Dude ... He was not giving a course on how to optimize the code ... He just give an example for us to understand the problem solving .... And by the way ... That's not optimization you basically add another problem to solve Instead : you can make the loop go through the half of the round (number) 🤝
@FoXcodeZ
@FoXcodeZ 2 күн бұрын
@@E.N77 He literally asked for that type of comment at 3:00, so you misunderstood my point. Rejecting unnecessary elements is part of optimization, aligning with Donald Knuth's statement: "Premature optimization is the root of all evil".
@christiantld
@christiantld 6 күн бұрын
Optimizing the function isPrime: - if num is 2 return true - if is even return false (all primes are odd) - we don't need to iterate over all numbers, just to square root of given number Optimizing the function printPrimesInRange: I'm not sure if it is a real optimization but i thought about using recursion over the elements of the array
@thecodinglion
@thecodinglion Күн бұрын
Congratulations
@ladiyehl
@ladiyehl 23 сағат бұрын
I gotcha you bro
@thecodinglion
@thecodinglion 22 сағат бұрын
Glad
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 181 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 241 М.
How I Overcame my FEAR Of Programming | K*ll the Imposter Syndrome
4:14
The Coding Lion
Рет қаралды 1,7 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 248 М.
Why You Shouldn't Nest Your Code
8:30
CodeAesthetic
Рет қаралды 2,8 МЛН
Avoiding These Mistakes Will Save You Years of Difficulty
5:26
The Coding Lion
Рет қаралды 3,1 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 770 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 311 М.
Portal with 3 parts: is this possible?
14:12
optozorax
Рет қаралды 80 М.
If you're ambitious but lazy, please watch this video...
12:57
Mark Tilbury
Рет қаралды 171 М.