Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(arr) {
- var tires = arr[0];
- var count = 0;
- var c1 = 4;
- var c2 = 10;
- var c3 = 3;
- for (var count1 = 0; count1 <= (tires / c1) + 1 ; count1++) {
- for (var count2 = 0; count2 <= (tires / c2) + 1 ; count2++) {
- for (var count3 = 0; count3 <= (tires / c3) + 1 ; count3++) {
- var all = (count1 * c1) + (count2 * c2) + (count3 * c3);
- if (all == tires) {
- count++;
- }
- }
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement