Given a group of buildings, we have to find the resulting skyline.

The brute force solution can be done in O(n2).

The most efficient solution to the problem involves using the divide and conquer technique

The solution to the problem along with the Java code is given at Find the skyline of a group of buildings – The Coding Interview Blog

This solution can be done in O(nlogn)