Hi there! There is no sorting done in my C++ solution but it is not able to pass only 1 test case. This is the code.

#include <iostream>using namespace std;int main() {long long n, i, j, r=20001, s=0, temp;cin >> n;long long arr[n][3];for (i=0; i<n; i++) {for (j=0; j<3; j++)cin >> arr[i][j]; // Taking a, b & cs += arr[i][0]; // Adding every a to stemp = arr[i][1] + arr[i][2]; // Adding every b & cif (temp<r) r = temp; // Storing smallest b+c in r}// Adding every a and smallest b+cs += r;cout << s;return 0;}

Read more… (26 words)