# Question: in java implement the method listsswaplargestandsecondsmallestarraylistltintegergt a that swaps the...

###### Question details

- In Java, implement the method Lists.swapLargestAndSecondSmallest(ArrayList<Integer> a) that swaps the largest and second smallest element in a. If there are multiple largest or second smallest elements, pick the first one. If all elements are the same, don't change anything. Your algorithm should be O(n). Check your answer with CodeCheck http://www.codecheck.it/files/161214081248b0jah3c7dttwa7b2ptynser