Why mistake I have done ??
Class Assignment
Getting segmentation fault
@ashwani225
The code you share in not for class Assignment question. Please check the link you have provided and share code for Class Assignment.
@ashwani225
You have not take input in correct format. Please check the sample input and your code. You are just taking single input as n.
That’s Ok but I want to ask how to stop consecutive b
@ashwani225
Please modify your code as per question format so that I would be easier for me to understand your code. Secondly, What is the purpose of taking both i and j in your assignment function? Both work in same way
https://ide.codingblocks.com/s/236745 . In this code I am asking if I input 2 then output will come [aa,ab,ba,bb]. I want to ask how to stop consecutive b to come so that I can count the outcome then format the code according to given question.
@ashwani225
The way you print output is wrong. You don’t have to print “#n : ans” but you have to print “#testcase_number : ans”.
For example :
3
3
2
1
for this tescase ans should be
#1 : 5
#2 : 3
#3 : 2