SORTVS - Editorial

Please provide comments in the code for easy understanding

its actually Iteration of All subsets of a mask Refer this for the proof SOS Dynamic Programming [Tutorial] - Codeforces