Write a method that counts how many elements in an unsorted array are out of order.
Anonymous
use the divide and conquer O(nlogn) algorithm similar to merge sort. while merging count the number of elements out of order. example: merging 4, 5 and 2, 3 should give 4.
Check out your Company Bowl for anonymous work chats.