PrimerPyLeetcoding: 4. Median of Two Sorted ArraysThere are multiple solutions to this problem, but one common approach is to use binary search to find the median. The idea is to partition…Jan 29, 2023Jan 29, 2023
PrimerPyLeetcoding: 6340. Count Increasing QuadrupletsOne approach to solve this problem is by using two nested loops to find i and j and then two more nested loops to find k and l. But this…Jan 30, 2023Jan 30, 2023
PrimerPyLeetcoding: 217. Contains DuplicateOne of the easiest solutions is to use Python’s built in data structures list and set. In Python, a set is an unordered collection data…Jan 30, 2023Jan 30, 2023
PrimerPyLeetcoding: 240 Search a 2D Matrix IIThe problem “Search a 2D Matrix II” asks us to find whether a target value is present in a given 2D matrix of integers. The matrix is…Feb 1, 2023Feb 1, 2023
PrimerPyLeetCoding: 283 Moving ZerosThis problem is the real interview question used at Bloomberg and Facebook. Given an array nums, write a function to move all 0’s to the…Feb 1, 2023Feb 1, 2023
PrimerPyLeetcoding 88: Merge Sorted ArrayHere are the steps to solve this problem:Feb 9, 2023Feb 9, 2023
PrimerPyLeetcoding 164: Max GapOne approach to solve this problem is to use the “Bucket Sort” algorithm. The basic idea is to divide the range of the elements into n-1…Feb 9, 2023Feb 9, 2023
PrimerPyLeetcoding: 905. Sort Array By ParityHere’s one possible solution in Python:Jan 29, 2023Jan 29, 2023