Miami, Florida 🏖️
To Thine Own Self Be True
Given:
O(n² + n) → Drop the n since n² grows faster.
Final: O(n²)
Example: The code in the image has nested loops (O(n²)) and a single loop (O(n)). We drop O(n), leaving O(n²).
#BigO #CodingTips #TimeComplexity
Given:
O(n² + n) → Drop the n since n² grows faster.
Final: O(n²)
Example: The code in the image has nested loops (O(n²)) and a single loop (O(n)). We drop O(n), leaving O(n²).
#BigO #CodingTips #TimeComplexity
It's been a few weeks since I've touched Python so I started with @neetcode1 's Python 🐍 for Coding Interviews as a Python refresher.
Completed the Merge Strings Alternatively problem on LeetCode:
It's been a few weeks since I've touched Python so I started with @neetcode1 's Python 🐍 for Coding Interviews as a Python refresher.
Completed the Merge Strings Alternatively problem on LeetCode: