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

Stats:

CreatedMay 6, 2017
PublishedMay 6, 2017
Warriors Trained16325
Total Skips522
Total Code Submissions29672
Total Times Completed12143
JavaScript Completions4669
Ruby Completions361
Dart Completions425
Python Completions3525
CoffeeScript Completions21
Crystal Completions14
PHP Completions332
Julia Completions32
TypeScript Completions308
C++ Completions750
C Completions186
NASM Completions27
COBOL Completions13
C# Completions466
Java Completions1044
Haskell Completions68
Rust Completions189
Go Completions356
Total Stars119
% of votes with a positive feedback rating93% of 1452
Total "Very Satisfied" Votes1269
Total "Somewhat Satisfied" Votes164
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