Aditya Gupta·Oct 6, 2024Intuitive method to find the next permutationIf you want to find a next permutation in lexicographically order, just take a deep breath and start with 1234 , 1243, 1324 and so on…
Aditya Gupta·Oct 3, 2024Half optimisationBe it 2*n or n/2, it is usually considered O(n) and you won’t get brownie points by the processor for doing its job easier. But in…