• + 1 comment

    O(n) time and O(1) auxiliary space

    https://www.hackerrank.com/challenges/beautiful-triplets/submissions/code/67927757