7 kyu
Replace all items
155 of 3,725wichu
Description:
Write function replaceAll
(Python: replace_all
) that will replace all occurrences of an item with another.
Python / JavaScript: The function has to work for strings and lists.
Example: replaceAll [1,2,2] 1 2 -> in list [1,2,2] we replace 1 with 2 to get new list [2,2,2]
replaceAll(replaceAll(array: [1,2,2], old: 1, new: 2) // [2,2,2]
Fundamentals
Arrays
Lists
Regular Expressions
Similar Kata:
Stats:
Created | Aug 12, 2016 |
Published | Aug 12, 2016 |
Warriors Trained | 6202 |
Total Skips | 398 |
Total Code Submissions | 19081 |
Total Times Completed | 3725 |
Haskell Completions | 155 |
Python Completions | 1235 |
F# Completions | 118 |
JavaScript Completions | 1059 |
C Completions | 406 |
Swift Completions | 760 |
Rust Completions | 131 |
Total Stars | 50 |
% of votes with a positive feedback rating | 88% of 689 |
Total "Very Satisfied" Votes | 550 |
Total "Somewhat Satisfied" Votes | 110 |
Total "Not Satisfied" Votes | 29 |
Total Rank Assessments | 19 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |