5 kyu
WinH's Kata #2 - JavaScript Array-Parser
104 of 110WinH
Description:
Task: Your task is to implement parseArray
function that parses the array representation to JS-Array
.
Examples:
"[1,2,3,4]" -> [1,2,3,4]
" [1.5, 2, 3, [1, 2, 3, [4]], 5]" -> [1.5, 2, 3, [1, 2, 3, [4]], 5]
In case of parse error return null
or Nothing
:
"abc" -> null
"1" -> null
"[1,2,3" -> null
"[#]" -> null
For simplicity, only number literals appear in the array:
"[0xFF, 1e2]" -> Just (A [ N 255, N 100 ])
Note:
require()
/eval()
/JSON.parse()
/new Function()
are disabled.
Data Structures
Algorithms
Similar Kata:
Stats:
Created | Jan 28, 2016 |
Published | Jan 28, 2016 |
Warriors Trained | 439 |
Total Skips | 22 |
Total Code Submissions | 1398 |
Total Times Completed | 110 |
JavaScript Completions | 104 |
Haskell Completions | 7 |
Total Stars | 17 |
% of votes with a positive feedback rating | 92% of 39 |
Total "Very Satisfied" Votes | 34 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 7 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |