8 kyu
Arguments to Binary addition
3,041 of 3,411Javatlacati
Description:
Given an array add all the number elements and return the binary equivalent of that sum; to make the code bullet proof anything else than a number should be added as 0 since it can't be added.
If your language can handle float binaries assume the array won't contain float or doubles.
arr2bin([1,2]) == '11'
arr2bin([1,2,'a']) == '11'
arr2bin([]) == '0'
NOTE: NaN is a number too in javascript for decimal, binary and n-ary base
This is a modification on the Kata: Array2Binary addition
hope you like it
Arrays
Binary
Fundamentals
Similar Kata:
Stats:
Created | Jun 17, 2016 |
Published | Jun 17, 2016 |
Warriors Trained | 6662 |
Total Skips | 239 |
Total Code Submissions | 22903 |
Total Times Completed | 3411 |
JavaScript Completions | 3041 |
CoffeeScript Completions | 28 |
TypeScript Completions | 357 |
PHP Completions | 103 |
Total Stars | 60 |
% of votes with a positive feedback rating | 84% of 636 |
Total "Very Satisfied" Votes | 484 |
Total "Somewhat Satisfied" Votes | 97 |
Total "Not Satisfied" Votes | 55 |