Can you please explain how this solution is working..?