7 kyu
Incrementer
4,669 of 12,143kkavita92
Description:
Given an input of an array of digits, return the array with each digit incremented by its position in the array: the first digit will be incremented by 1, the second digit by 2, etc. Make sure to start counting your positions from 1 ( and not 0 ).
Your result can only contain single digit numbers, so if adding a digit with its position gives you a multiple-digit number, only the last digit of the number should be returned.
Notes:
- return an empty array if your array is empty
- arrays will only contain numbers so don't worry about checking that
Examples:
[1, 2, 3] --> [2, 4, 6] # [1+1, 2+2, 3+3]
[4, 6, 9, 1, 3] --> [5, 8, 2, 5, 8] # [4+1, 6+2, 9+3, 1+4, 3+5]
# 9+3 = 12 --> 2
Fundamentals
Similar Kata:
Stats:
Created | May 6, 2017 |
Published | May 6, 2017 |
Warriors Trained | 16325 |
Total Skips | 522 |
Total Code Submissions | 29672 |
Total Times Completed | 12143 |
JavaScript Completions | 4669 |
Ruby Completions | 361 |
Dart Completions | 425 |
Python Completions | 3525 |
CoffeeScript Completions | 21 |
Crystal Completions | 14 |
PHP Completions | 332 |
Julia Completions | 32 |
TypeScript Completions | 308 |
C++ Completions | 750 |
C Completions | 186 |
NASM Completions | 27 |
COBOL Completions | 13 |
C# Completions | 466 |
Java Completions | 1044 |
Haskell Completions | 68 |
Rust Completions | 189 |
Go Completions | 356 |
Total Stars | 119 |
% of votes with a positive feedback rating | 93% of 1452 |
Total "Very Satisfied" Votes | 1269 |
Total "Somewhat Satisfied" Votes | 164 |
Total "Not Satisfied" Votes | 19 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |