there n employee unique i d 0 n 1you give 2D integer array log logsi idi leaveTimei whereidi i d employee work ith task andleaveTimei time employee finish ith task all value leaveTimei uniquenote ith task start moment right 1th task end 0th task start time 0return i d employee work task long time if tie employee return smallest i d Example 1input n 10 log 032509115output 1explanation Task 0 start 0 end 3 3 unit timesTask 1 start 3 end 5 2 unit timesTask 2 start 5 end 9 4 unit timestask 3 start 9 end 15 6 unit timesthe task long time task 3 employee i d 1 work return 1example 2input n 26 log 1137212717output 3explanation Task 0 start 0 end 1 1 unit timesTask 1 start 1 end 7 6 unit timesTask 2 start 7 end 12 5 unit timestask 3 start 12 end 17 5 unit timesthe task long time task 1 the employee work 3 return 3example 3input n 2 log 010120output 0explanation Task 0 start 0 end 10 10 unit timesTask 1 start 10 end 20 10 unit timesthe task long time task 0 1 the employee work 0 1 return smallest i d 0 Constraints2 n 5001 logslength 500logsilength 20 idi n 11 leaveTimei 500idi idi1leavetimei sort strictly increase order