7 kyu
Operations with sequence
118 of 1,355arkada38
Description:
Steps
- Square the numbers that are greater than zero.
- Multiply by 3 every third number.
- Multiply by -1 every fifth number.
- Return the sum of the sequence.
Example{ -2, -1, 0, 1, 2 }
returns -6
1. { -2, -1, 0, 1 * 1, 2 * 2 }
2. { -2, -1, 0 * 3, 1, 4 }
3. { -2, -1, 0, 1, -1 * 4 }
4. -6
P.S.: The sequence consists only of integers. And try not to use "for", "while" or "loop" statements.
Fundamentals
Arrays
Similar Kata:
Stats:
Created | Jul 18, 2017 |
Published | Jul 18, 2017 |
Warriors Trained | 2055 |
Total Skips | 53 |
Total Code Submissions | 4068 |
Total Times Completed | 1355 |
C# Completions | 118 |
JavaScript Completions | 463 |
Python Completions | 472 |
Rust Completions | 240 |
R Completions | 77 |
Haskell Completions | 63 |
Total Stars | 21 |
% of votes with a positive feedback rating | 89% of 304 |
Total "Very Satisfied" Votes | 247 |
Total "Somewhat Satisfied" Votes | 45 |
Total "Not Satisfied" Votes | 12 |
Total Rank Assessments | 53 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |