Load balancer doubt

why does the greedy approach work for this problem.

hi @vaishnavi20001611 it is generally very difficult to produce a “proof” for a greedy problem

are there any tips to identify when to use greedy

hi @vaishnavi20001611

If both of the properties below are true, a greedy algorithm can be used to solve the problem.

  • Greedy choice property: A global (overall) optimal solution can be reached by choosing the optimal choice at each step.
  • Optimal substructure: A problem has an optimal substructure if an optimal solution to the entire problem contains the optimal solutions to the sub-problems.