
You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1 .
Additionally, you are given a 2D integer array offers where offers[i] = [start _i , end _i , gold _i ] , indicating that i ^th buyer wants to buy all the houses from start _i to end _i for gold _i amount of gold.
As a salesman, your goal is to maximize your earnings by strategically selecting and selling houses to buyers.
Return the maximum amount of gold you can earn .
Note that different buyers can't buy the same house, and some houses may remain unsold.
1 <= n <= 10 ^51 <= offers.length <= 10 ^5offers[i].length == 30 <= start _i <= end _i <= n - 11 <= gold _i <= 10 ^3