Leetcode Contest Problems

Hello, I'm Paras Kaushik! ๐ I'm a dedicated software engineer based in India, specializing in C++ and proficient in the MERN stack.
๐ค Interested in collaborating on innovative projects that require my technical expertise.
๐ฌ Passionate about participating in discussions related to software architecture and best practices.
๐ง Feel free to reach out to me via email: [paraskaushik12@gmail.com]
๐ Connect with me on LinkedIn: [https://www.linkedin.com/in/the-paras-kaushik/]
Leetcode Weekly Contest 387
3069. Distribute Elements Into Two Arrays I

3070. Count Submatrices with Top-Left Element and Sum Less Than k

This is a dynamic programming problem

3071.Minimum Operations to write `Y` on grid

We can clearly see via the constraints that is is a backtracking problem

3072. Distribute Elements Into Two Arrays II

The problem is a application problem of lower and upper bound :

Notes
For set iterators arithmetic operations dont work like they do for array iterators ex. the operator
-is not defined for the iterators ofstd::sets (bidirectional iterators) while it's defined for the arrays iterators (random access iterators).Instead, you can use
std::distance(), as followsint main() { set<int> set {1, 2, 4, 5, 6}; int number = 3; int lbIdx=distance(set.begin(), set.lower_bound(number)) ; cout<<"lower bound Index"<< lbIdx <<endl; }




