6 kyu

Create Phone Number

127,089 of 349,872xDranik

Description:

Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.

Example

createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
createPhoneNumber(int[10]{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}) // => returns "(123) 456-7890"
create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890"
createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890"
createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890"
Kata.createPhoneNumber(new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}) // => returns "(123) 456-7890"
createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
createPhoneNumber [1,2,3,4,5,6,7,8,9,0] -- => returns "(123) 456-7890"
Kata.CreatePhoneNumber(new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}) // => returns "(123) 456-7890"
createPhoneNumber [1; 2; 3; 4; 5; 6; 7; 8; 9; 0] // => returns "(123) 456-7890"
create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890"
Kata.createPhoneNumber(Seq(1, 2, 3, 4, 5, 6, 7, 8, 9, 0)) # => returns "(123) 456-7890"
createPhoneNumber([1,2,3,4,5,6,7,8,9,0]); // => returns "(123) 456-7890"
createPhoneNumber [1; 2; 3; 4; 5; 6; 7; 8; 9; 0] // => returns "(123) 456-7890"
(create-phone-number [1 2 3 4 5 6 7 8 9 0]) ;; => returns "(123) 456-7890"
create_phone_number(&[1,2,3,4,5,6,7,8,9,0]); // returns "(123) 456-7890"
CreatePhoneNumber([10]uint{1,2,3,4,5,6,7,8,9,0})  // returns "(123) 456-7890"
create_phone_number(phnum, (const unsigned char[]){1,2,3,4,5,6,7,8,9,0});
    /* phnum <- "(123) 456-7890" */
phnum:  resb 15
nums:   db  1,2,3,4,5,6,7,8,9,0

mov rdi, phnum
mov rsi, nums
call create_phone_number  ; RAX <- phnum <- "(123) 456-7890" 
createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
createphonenumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # -> returns "(123) 456-7890"
createPhoneNumber( [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] ) // => returns "(123) 456-7890"
{ 1 2 3 4 5 6 7 8 9 0 } create-phone-number ! returns "(123) 456-7890"
create_phone_number({ 1,2,3,4,5,6,7,8,9,0 }) -- => returns "(123) 456-7890"

The returned format must be correct in order to complete this challenge.

Don't forget the space after the closing parentheses!

Arrays
Strings
Regular Expressions
Algorithms

Stats:

CreatedOct 17, 2013
PublishedOct 17, 2013
Warriors Trained594784
Total Skips47960
Total Code Submissions806390
Total Times Completed349872
JavaScript Completions127089
CoffeeScript Completions334
Ruby Completions9134
Java Completions39555
Dart Completions2099
Haskell Completions1810
C# Completions22704
Python Completions115246
Scala Completions966
Groovy Completions157
Crystal Completions66
PowerShell Completions314
Go Completions4574
C Completions4524
NASM Completions63
Rust Completions3262
PHP Completions6629
Clojure Completions407
C++ Completions14155
Julia Completions169
CFML Completions42
Factor Completions19
F# Completions98
COBOL Completions38
Lua Completions333
TypeScript Completions4159
BF Completions50
Total Stars3740
% of votes with a positive feedback rating85% of 28326
Total "Very Satisfied" Votes20870
Total "Somewhat Satisfied" Votes6517
Total "Not Satisfied" Votes939
Ad
Contributors
  • xDranik Avatar
  • jhoffner Avatar
  • Unnamed Avatar
  • GiacomoSorbi Avatar
  • Jotha Avatar
  • lessonteacher Avatar
  • andreapt82 Avatar
  • kodejuice Avatar
  • gttotev Avatar
  • AntonRatnick Avatar
  • aweleshetu Avatar
  • eXeC64 Avatar
  • romerojp Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • ThorstenLudwig Avatar
  • Voile Avatar
  • Souzooka Avatar
  • AndyGauge Avatar
  • fivemoreminix Avatar
  • danmbyrd Avatar
  • FArekkusu Avatar
  • bdw429s Avatar
  • vp217 Avatar
  • hobovsky Avatar
  • Console Cowboy Avatar
  • cliffstamp Avatar
  • uniapi Avatar
  • stellartux Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • zLuki Avatar
  • ejini战神 Avatar
  • user2058606 Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • Just4FunCoder Avatar
  • sid114 Avatar
  • jeydo6 Avatar
  • fcr-- Avatar
Ad