Yashraj1402's blog

By Yashraj1402, history, 3 months ago, In English

Problem Link

My Approach:

Only make the first element of vector A less than vector B. So if B[0] < A[0], iterate over A and find the first element smaller than B[0] by this we will also know the number of swaps required to change the first element of A. Then iterate over B and find the first element greater than A[0] by this we will know the number of swaps required to change the first element of B. Print the minimum number of swaps.

solution Link ,546th test case fails.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it