7 kyu
Incrementer
4,621 of 11,981kkavita92
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 | 16123 |
Total Skips | 512 |
Total Code Submissions | 29308 |
Total Times Completed | 11981 |
JavaScript Completions | 4621 |
Ruby Completions | 357 |
Dart Completions | 421 |
Python Completions | 3481 |
CoffeeScript Completions | 20 |
Crystal Completions | 14 |
PHP Completions | 328 |
Julia Completions | 32 |
TypeScript Completions | 302 |
C++ Completions | 737 |
C Completions | 182 |
NASM Completions | 25 |
COBOL Completions | 13 |
C# Completions | 456 |
Java Completions | 1034 |
Haskell Completions | 68 |
Rust Completions | 183 |
Go Completions | 335 |
Total Stars | 117 |
% of votes with a positive feedback rating | 93% of 1442 |
Total "Very Satisfied" Votes | 1260 |
Total "Somewhat Satisfied" Votes | 163 |
Total "Not Satisfied" Votes | 19 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |