Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Sum of positive
You get an array of numbers, return the sum of all of the positives ones. Example [1,-4,7,12] => 1 + 7 + 12 = 20 조금 더 효율적인 코드로 개선해보면
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Sum of positive
You get an array of numbers, return the sum of all of the positives ones. Example [1,-4,7,12] => 1 + 7 + 12 = 20 조금 더 효율적인 코드로 개선해보면
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Count by X
Create a function with two arguments that will return a list of length (n) with multiples of (x). Assume both the given number and the number of times to count will be positive numbers greater than 0.Return the results as an array (or list in Python, Haskell or Elixir). Examples: countBy(1,10) === [1,2,3,4,5,6,7,8,9,10] countBy(2,5) === [2,4,6,8,10] 이런 방법으로 첫 코딩을 작성했다. 좀 더 보기 좋은 코드로는 이렇게 작성도 가능하다.
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Opposite number
Very simple, given a number, find its opposite. Examples: 1: -1 14: -14 -34: 34
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Jenny's secret message
Description: Jenny has written a function that returns a greeting for a user. However, she's in love with Johnny, and would like to greet him slightly different. She added a special case to her function, but she made a mistake. Can you help her?
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] UEFA EURO 2016
Description: Finish the uefaEuro2016() function so it return string just like in the examples below: uefaEuro2016(['Germany', 'Ukraine'],[2, 0]) // "At match Germany - Ukraine, Germany won!" uefaEuro2016(['Belgium', 'Italy'],[0, 2]) // "At match Belgium - Italy, Italy won!" uefaEuro2016(['Portugal', 'Iceland'],[1, 1]) // "At match Portugal - Iceland, teams played draw."
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Double Char
Given a string, you have to return a string in which each character (case-sensitive) is repeated once. doubleChar("String") ==> "SSttrriinngg" doubleChar("Hello World") ==> "HHeelllloo WWoorrlldd" doubleChar("1234!_ ") ==> "11223344!!__ "
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] Even or Odd
이렇게 코드를 작성해 봤는데 3항 연산자를 활용해서 하나 더 만들어 봤습니다.
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] 문자열 다루기
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] 정수 제곱근 판별하기
Computer science/알고리즘
[자바스크립트로 구현한 알고리즘] 핸드폰번호 가리기
Computer science/Data Structure
자바스크립트로 구현한 선택정렬
자바스크립트로 구현한 선택 정렬입니다.