title: Removing last n elements from arrayList in Java
body: <p>Example:</p>
  
  <p>list1 = [10,20,30,40,50]  size = 5  </p>
  
  <p>Based on size of list1=5 I need to remove last 5 elements from list2<br>
  list2 = [11,23,32,12,21,21]  </p>
  
  <p>Output = [11]  </p>
  
  <p>So if size of list1 is n I need to remove last n elements from list 2 ?<br>
  What is an efficient way to achieve this ?  </p>