add solution to non adjacent sequence problem