Update noTwoConsecutive.cpp

Corrected the implementation of function solve(n);