Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,226 views

For proper oa or interview experiences list of all top tech companies visit :

https://oa.desiqna.in

https://interview.desiqna.in

 

in Online Assessments by Expert (44,360 points) | 1,226 views

1 Answer

0 like 0 dislike

Online Assessment Question :

image

image

image

image

image

 

by Expert (44,360 points)
0 0
bool sum(int B){
 float x=(-1+sqrt(1+8*B))/2;

 if(ceil(x)==floor(x))
  return true;
 else
  return false;
}

int maxIndex(int steps, int badIndex){

 long long int max = ((steps)*(steps+1))/2;

 bool t = sum(badIndex);

 if(t){
  return max - 1;
 }
 else{
  return max;
 }
}