8 kyu

Add new item (collections are passed by reference)

894 of 6,511aryan-firouzian

Description:

Add an item to the list:

AddExtra method adds a new item to the list and returns the list. The new item can be any object, and it does not matter. (lets say you add an integer value, like 13)

In our test case we check to assure that the returned list has one more item than the input list. However the method needs some modification to pass this test.

P.S. You have to create a new list and add a new item to that. (This Kata is originally designed for C# language and it shows that adding a new item to the input list is not going to work, even though the parameter is passed by value, but the value is poining to the reference of list and any change on parameter will be seen by caller)

Fundamentals

Stats:

CreatedDec 13, 2015
PublishedDec 13, 2015
Warriors Trained10656
Total Skips268
Total Code Submissions26441
Total Times Completed6511
C# Completions894
Python Completions2720
Ruby Completions226
JavaScript Completions2864
COBOL Completions10
Total Stars59
% of votes with a positive feedback rating74% of 1148
Total "Very Satisfied" Votes733
Total "Somewhat Satisfied" Votes224
Total "Not Satisfied" Votes191
Total Rank Assessments17
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • aryan-firouzian Avatar
  • ZozoFouchtra Avatar
  • Weemän Avatar
  • myjinxin2015 Avatar
  • methree Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • akar-0 Avatar
  • saudiGuy Avatar
Ad