my doubt is how is the implementation next_permutation method internally?
Sir doubt in next_permutation method
@tejasddongare refer this
(http://www.cplusplus.com/reference/algorithm/next_permutation/)
dont forget to hit like and mark resolved if cleared 
so sir can we say that for upper bond internally the condition in if would be <= isnt it?