Problem You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out. For example, if your niece is turning 4years old, and the cake will have 4candles of height 4,4,1,3 ..
Problem Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers. Example let arr = [1, 3, 5, 7, 9] The minimum sum is 1 + 3 + 5 + 7 = 16 and the maximum sum is 3 + 5 + 7 + 9 = 24. The function prints 16 24 Soluti..
Question Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. 주어진 Array안에서 negative value, positive value 그리고 0 의 수가 array크기에 얼마나 비례하는지 소수점 6자리까지 프린트하는 문제. Example output 0.400000 0.400000 0.200000 Solution let arr = [1, 1, 0, -1, -1]; function diagonalDiffer..
Option 1. If you already have installed Node.js, simply type node 'your JS file' to run your code. JavaScript engine 이 node.js 에 있어서 Browser 와 index.html 없이도 excute될 수 있다. Option 2. 1. enable Live Edit 2. Set Chrome as a default browser 3. Click the debug button to open the Chrome browser. 4. In Chrome, press alt + cmd + i to launch developer tools to check the result.
Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. 2d array 의 서로 다른 두 개의 대각선 값의 Absolute difference 즉, 절대값을 결과로 보여주는 문제. For example, 1 2 3 4 5 6 9 8 9 (1 + 5 + 9) - (3 + 5+ 9) |15 - 17| the absolute difference is 2. Tip. 0 1 2 0 o x o 1 x o x 2 o x o 필요한 부분이 나오는 배열의 형태를 먼저 적어주고 그 형태가 나올 수 있는 loop의 형태를 고민해 본다. 2d Array는 loop를 적용시키면 Column(세로) 이 순..
- Total
- Today
- Yesterday
- spring boot application
- ... in Javascript
- hackerrank solution
- code refactoring
- rest parameter
- equals()
- Javascript Algorithm
- algorithm
- 알고리즘
- Collection Framework
- 프로그래머스 알고리즘문제
- easy javascript algorithm
- math.max
- easy algorithm
- substring()
- javascript
- 프로그래머스 알고리즘
- C++
- Object type casting
- math.abs
- repeat()
- compareTo()
- 프로그래머스
- hackerrank
- hackerrank javascript
- HashMap
- HackerRank Algorithm
- string class in java
- java
- hackerrank javascript solution
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |