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

Stats:

CreatedMay 6, 2017
PublishedMay 6, 2017
Warriors Trained16123
Total Skips512
Total Code Submissions29308
Total Times Completed11981
JavaScript Completions4621
Ruby Completions357
Dart Completions421
Python Completions3481
CoffeeScript Completions20
Crystal Completions14
PHP Completions328
Julia Completions32
TypeScript Completions302
C++ Completions737
C Completions182
NASM Completions25
COBOL Completions13
C# Completions456
Java Completions1034
Haskell Completions68
Rust Completions183
Go Completions335
Total Stars117
% of votes with a positive feedback rating93% of 1442
Total "Very Satisfied" Votes1260
Total "Somewhat Satisfied" Votes163
Total "Not Satisfied" Votes19
Total Rank Assessments10
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • kkavita92 Avatar
  • raulbc777 Avatar
  • anter69 Avatar
  • ParanoidUser Avatar
  • Chrono79 Avatar
  • JohanWiltink Avatar
  • Madjosz Avatar
  • monadius Avatar
  • hobovsky Avatar
  • uniapi Avatar
  • trashy_incel Avatar
  • Aizaz_Ahmad Avatar
  • user8436785 Avatar
  • akar-0 Avatar
  • dfhwze Avatar
Ad