7 kyu
Row Weights
1,381 of 24,814MrZizoScream
Description:
Several people are standing in a row divided into two teams. The first person goes into team 1, the second goes into team 2, the third goes into team 1, and so on.
Task
Given an array of positive integers (the weights of the people), return a new array / tuple of two integers (depending on your language), whereby the first one is the total weight of team 1, and the second one is the total weight of team 2. Note that the array will never be empty.
Examples
[13, 27, 49]
returns[62, 27]
or(62, 27)
(depending on your language) because the total weight of team 1 is and the total weight of team 2 is .[50, 60, 70, 80]
returns[120, 140]
or(120, 140)
(depending on your language) because the total weight of team 1 is and the total weight of team 2 is .[80]
returns[80, 0]
or(80, 0)
(depending on your language) because the total weight of team 1 is and the total weight of team 2 is .
Fundamentals
Arrays
Similar Kata:
Stats:
Created | Mar 29, 2018 |
Published | Mar 29, 2018 |
Warriors Trained | 34227 |
Total Skips | 3562 |
Total Code Submissions | 51837 |
Total Times Completed | 24814 |
C++ Completions | 1381 |
Ruby Completions | 513 |
JavaScript Completions | 9179 |
Python Completions | 6785 |
Crystal Completions | 16 |
C Completions | 586 |
Java Completions | 3048 |
C# Completions | 1018 |
Haskell Completions | 166 |
Rust Completions | 625 |
Dart Completions | 790 |
VB Completions | 132 |
PHP Completions | 607 |
Julia Completions | 39 |
NASM Completions | 19 |
CoffeeScript Completions | 14 |
TypeScript Completions | 479 |
Reason Completions | 9 |
Elixir Completions | 99 |
CFML Completions | 17 |
Clojure Completions | 76 |
Prolog Completions | 31 |
COBOL Completions | 10 |
Total Stars | 269 |
% of votes with a positive feedback rating | 94% of 2718 |
Total "Very Satisfied" Votes | 2399 |
Total "Somewhat Satisfied" Votes | 299 |
Total "Not Satisfied" Votes | 20 |
Total Rank Assessments | 18 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |