MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / func11

Function func11

CPP/pandigital_numbers/code.cpp:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75vector<int> func11(string str, vector<int> &values)
76{
77 int num = stoi(str);
78 int a, b;
79 b = num % 10;
80 num /= 10;
81 a = num % 10;
82 num /= 10;
83
84 vector<int> vec;
85
86 for (int i = 0; i < values.size(); i++)
87 {
88 if ((abs(a + i - b)) % 11 == 0 && values[i] == 0)
89 {
90 vec.push_back(i);
91 }
92 }
93
94 return vec;
95}
96
97vector<int> func13(string str, vector<int> &values)
98{

Callers 1

funcFunction · 0.85

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected