Please read the new rule regarding the restriction on the use of AI tools. ×

Is my Approadch wrong?
Difference between en1 and en2, changed 3 character(s)
Submission ID: 66585414↵
Problem : 1201/C   C. Maximum Median↵

I am first calculating that for median to be ar[i], can we go there by swapping?↵
Once done, all elements in second half of array are equal and i am still left with k, its easy to increase median by increasing all elements by 1 each.↵
Please tell if this approach is fine or not, Getting WA at test case 6

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English TTMMM 2019-12-10 14:10:24 3
en1 English TTMMM 2019-12-10 14:09:57 390 Initial revision (published)