https://ahampriyanshu.com/Priyanshu TiwariHello and welcome to my blog. I usually write about programming, finance, and comedy. You can reach me at ahampriyanshu@gmail.com 2022-12-02T04:56:18+05:30 Priyanshu Tiwari https://ahampriyanshu.com/ Jekyll © 2022 Priyanshu Tiwari /assets/img/favicons/favicon.ico /assets/img/favicons/favicon-96x96.png Weekly and Biweekly Contests | November | Leetcode2022-11-26T00:00:00+05:30 2022-11-26T00:00:00+05:30 https://ahampriyanshu.com/blog/weekly-biweekly-contest-leetcode-november-2022/ ahampriyanshu Biweekly Contest 92 2481. Minimum Cuts to Divide a Circle A valid cut in a circle can be: A cut that is represented by a straight line that touches two points on the edge of the circle and passes through its center, or A cut that is represented by a straight line that touches one point on the edge of the circle and its center. Some valid and invalid cuts are shown in the figures below... Introductory Problems | CSES2022-11-26T00:00:00+05:30 2022-11-26T00:00:00+05:30 https://ahampriyanshu.com/blog/sorting-and-searching/ ahampriyanshu Distinct Numbers You are given a list of n integers, and your task is to calculate the number of distinct values in the list. Problem #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, e; cin >> n; unordered_map<int, int> mp; for (int i = 0; i < n; i++) { cin >... October | 2022 | POTD GFG2022-10-01T00:00:00+05:30 2022-10-01T00:00:00+05:30 https://ahampriyanshu.com/blog/october-problem-of-the-day-geeks-for-geeks/ ahampriyanshu 01 | Number of Distinct Islands Given a boolean 2D matrix grid of size $n /times m$. You have to find the number of distinct islands where a group of connected 1s (horizontally or vertically) forms an island. Two islands are considered to be distinct if and only if one island is not equal to another (not rotated or reflected). void dfs(vector<vector<int>>& grid, int x0, ... September | 2022 | POTD GFG2022-09-01T00:00:00+05:30 2022-09-01T00:00:00+05:30 https://ahampriyanshu.com/blog/september-problem-of-the-day-geeks-for-geeks/ ahampriyanshu 02 | Minimum Cost to cut a board into squares A board of length $M$ and width $N$ is given. The task is to break this board into $M * N$ squares such that cost of breaking is minimum. The cutting cost for each edge will be given for the board in two arrays $X[]$ and $Y[]$. In short, you need to choose such a sequence of cutting such that cost is minimized. Return the minimized cost. int... STL Cheat Sheet2022-08-28T00:00:00+05:30 2022-08-28T00:00:00+05:30 https://ahampriyanshu.com/blog/stl-cheatsheet/ ahampriyanshu pair utility container Used to store two data object in a single container #include <iostream> using namespace std int main(){ pair<int, int> p1; pair<int, int> p2(303, 52); pair<int, char> p3(1, 'a'); pair<int, int> p4(p3); pair<int, int> p5 = {2, 'b'}; pair<int, int> p6 = make_pair('A', 1); } Input/Output cout << p.first ...