int main() { Quipu x; int res = x.readKnots("-XX--XXXX---XXX-"); cout << res << endl; return 0; }
double test2() { string p0 = "-X-"; Quipu * obj = new Quipu(); clock_t start = clock(); int my_answer = obj->readKnots(p0); clock_t end = clock(); delete obj; cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl; int p1 = 1; cout <<"Desired answer: " <<endl; cout <<"\t" << p1 <<endl; cout <<"Your answer: " <<endl; cout <<"\t" << my_answer <<endl; if (p1 != my_answer) { cout <<"DOESN'T MATCH!!!!" <<endl <<endl; return -1; } else { cout <<"Match :-)" <<endl <<endl; return (double)(end-start)/CLOCKS_PER_SEC; } }
int main(int argc, char *argv[]) { Quipu obj; cout<<obj.readKnots("-XX--XXXX-XXX-")<<endl; }
void testCase4() { string knots = "-XXXXXXXXX--XXXXXXXXX-XXXXXXXXX-XXXXXXX-XXXXXXXXX-"; int expected_ = 909979; assertEquals(4, expected_, solution.readKnots(knots)); }
void testCase3() { string knots = "-X-------"; int expected_ = 1000000; assertEquals(3, expected_, solution.readKnots(knots)); }
void testCase2() { string knots = "-X-"; int expected_ = 1; assertEquals(2, expected_, solution.readKnots(knots)); }
void testCase1() { string knots = "-XX--XXXX---XXX-"; int expected_ = 204003; assertEquals(1, expected_, solution.readKnots(knots)); }
void testCase0() { string knots = "-XX-XXXX-XXX-"; int expected_ = 243; assertEquals(0, expected_, solution.readKnots(knots)); }