Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
854 views
in Online Assessments by Expert (44,360 points) | 854 views

1 Answer

0 like 0 dislike

1.Given coordinates of points, Find three points which are colinear.

Input: (0,0),(1,1),(2,2),(3,3)
Ouput: 2 triplets are colinear

points value : [1,1000]


2. For a given array, a subset of three points is said to be aligned if the distance between any two points within the subset is divisible by M

Input: A[]={-3,-2,1,0,8,7,1} M=3
Ouput: 4 

Answer: -2,1,-,7,1= 4points.
If we take any two points there abs diff or distnce is going to be divisible by 3

by Expert (44,360 points)