Java Skyline Problem Solution