You are viewing a single comment's thread. Return to all comments →
can some suggesset how this can be optimized?
int TotalHealthOfUnhealthiest (int first, int last, string d, vector<string> genes, vector<int> health) { int result = 0, hvalue, start, end, sub; for(int i = first; i <= last; i++) { string str = genes[i]; start = 0; end = str.size(); while(d.size() >= end) { string dsub = ""; sub = start; while(sub < end) { dsub += d[sub]; sub++; } if(str == dsub) { result += health[i]; } start++; end++; } } return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Determining DNA Health
You are viewing a single comment's thread. Return to all comments →
can some suggesset how this can be optimized?