Beautiful Pairs

  • + 1 comment

    This worked, but could you also explain how does this logic work ?