Hey john. Best of LUCK man You're gonna make it for sure. Keep going
@John-Wilkins20 күн бұрын
Thanks man! Let's chase our dreams until they get tired and lie down.
@montralanca19 күн бұрын
hope u get a job, i got one yesterday
@John-Wilkins19 күн бұрын
Congratulations dude! 🎉
@montralanca18 күн бұрын
@@John-Wilkins thank you, i had an approach similar to yours, just started to crunch a lot of code and reading, and getting to know different libs, basically facing everything nonstop - was actually solid, u prob gonna make it soon if youre interviewing
@michaelharrington586021 күн бұрын
Nested (for) loops aren't indicative of quadratic time complexity. Fixed Inner Loop: for (let i = 0; i < n; i++) { for (let j = 0; j < 10; j++) { // constant size // do something } } This is O(n) because the inner loop is constant time - it always runs 10 times regardless of n. Decreasing Inner Loop: for (let i = 0; i < n; i++) { for (let j = 0; j < n - i; j++) { // do something } } This is actually O(n²/2), which simplifies to O(n²), but it's a good example of how not all nested loops do the same amount of work. Halving Inner Loop: for (let i = 0; i < n; i++) { for (let j = 0; j < n; j += i + 1) { // step size increases // do something } } This is O(n log n) because the inner loop makes fewer iterations as i increases. Different Collection Sizes: for (let i = 0; i < n; i++) { for (let j = 0; j < m; j++) { // different size // do something } } This is O(n*m), which could be better or worse than O(n²) depending on the relationship between n and m. Time complexity depends on how many total iterations occur, not just the fact that loops are nested.