SPOJ - A Game with Numbers O(1) solution
Solution:-
using namespace std;
int main()
{
int N;
cin>>N;
if(N%10==0)
cout<<"2";
else
cout<<"1"<<endl<<N%10;
return 0;
}
Here, you may find the solutions to famous problems of various coding platforms like SPOJ || HACKEREARTH etc. Please leave a comment in case you need solution or editorial to any problem. Get Solutions || Editorials of Famous DP problems. Happy Coding :)