Basic Hygiene Leave the place cleaner than you got it. Naming Convention Do one thing in a function. Name should reflect the action. Function name is a verb. Declare literals ([a-z]+, [0-9]+) as constants. Functions The function should not exceed twenty lines. Each if, else, while statement can become a function. The function can have … More How to Write Clean Code?
Problem Given a matrix, find the path from top left to bottom right with the greatest product by moving only down and right. The code is in C++. The only moves allowed are down and right. The solution works for positive numbers. Reference https://www.byte-by-byte.com/matrixproduct/?utm_source=optin_carrot&utm_medium=pdf&utm_campaign=50questions Written with StackEdit.
The following code has two implementations of finding median of two sorted arrays in O(n) and O(log n). Reference https://www.youtube.com/watch?v=MHNTl_NvOj0 The most lucid explanation of the code.