You are viewing a single comment's thread. Return to all comments →
C#
You probably don't need the "continue" if you check both ">" and "<" like @fabinvieira did though.
public static List<int> compareTriplets(List<int> a, List<int> b) { int scoreA = 0; int scoreB = 0; for(int i = 0; i < a.Count; i++) { if(a[i] == b[i]) continue; if(a[i] > b[i]) scoreA++; else scoreB++; } return new List<int>(){scoreA, scoreB}; }
Seems like cookies are disabled on this browser, please enable them to open this website
Compare the Triplets
You are viewing a single comment's thread. Return to all comments →
C#
You probably don't need the "continue" if you check both ">" and "<" like @fabinvieira did though.