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.
So, 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 to 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.