Algorithm To Solve The 2nd Layer