Hello everyone, I want to learn from my mistakes and so since I have no one to help me out so am writing this blog.
Qn1
Given coordinates of points on a 2d plane. [At max 100 points (0<=x,y<=100)].
You need to find the minimum cost rectangle such that it has atleast k points.(1<=k<=100)
Cost is decided by 2*(length + breadth) of the rectangle.
If anyone has a better approach then please write it in comments section :)
Qn2
Given two numbers A and B. Find if it is possible to transform A to B using the following operations any number of times.
1) If A is odd then you can subtract 1 from it
2) If A is even then you can add 1 to it
3) If A is even you can divide it by 2
4) If A is even/odd you can multiply it by 2
If its possible to transform A to B then print the minimum number of operations required else print -1.
Constraints: 1<=A,B<=10^18
Qn3
Given a rooted tree with N nodes. Each node has some value Ci assigned to it. For each node in the tree, print the MEX(the smallest number not present in a pool of values]) of the values present in its subtree. Constraints: 1<=N<=10^5, 1<=Ci<=N-1, All Ci values are distinct and unique.




