i always have a problem with all greedy problem that is not easy to see its optimal choice ?
some times i get an intuition but i am not sure it works 100% how would i improve my proving skills for greedy .would i try my intuition with code and check if it will get a WA or not ? some tips from you please .
Code your greedy, code a naive working code, test if for a lot of random (small) inputs. Check if your greedy code is working fine. It reduces the chance of getting WA.
Without proving it ?
It's usually easier to just test the greedy code than to actually prove it.