You are viewing a single comment's thread. Return to all comments →
C# static int getMoneySpent(int[] keyboards, int[] drives, int b) { var expensiveOption = -1;
for (int i = 0; i < keyboards.Length; i++) { var keyboardValue = keyboards[i]; for (int j = 0; j < drives.Length; j++) { var driveValue = drives[j]; var totalValue = keyboardValue + driveValue; if (totalValue <= b) { if (expensiveOption < totalValue) { expensiveOption = totalValue; } } } } return expensiveOption;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
C# static int getMoneySpent(int[] keyboards, int[] drives, int b) { var expensiveOption = -1;
}