Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
1,246 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 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;
 }
}
...