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

Function func3

CPP/pandigital_numbers/code.cpp:6–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const int inf = 1e9 + 7;
5
6vector<int> func3(string str, vector<int> &values)
7{
8 int num = stoi(str);
9 int a, b;
10 b = num % 10;
11 num /= 10;
12 a = num % 10;
13 num /= 10;
14
15 vector<int> vec;
16
17 for (int i = 0; i < values.size(); i++)
18 {
19 if (values[i] == 0)
20 {
21 if ((i + a + b) % 3 == 0)
22 {
23 vec.push_back(i);
24 }
25 }
26 }
27 return vec;
28}
29
30vector<int> func5(string str, vector<int> &values)
31{

Callers 1

funcFunction · 0.85

Calls 2

push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected