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..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bRdzu7/btqF4UFFJLd/uULknK9rw60dh5Hj9YCVMk/img.png)
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.
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bP2Scg/btqF5d5TTDS/tvHXKZFeZvkc6YMU13h7O0/img.jpg)
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(세로) 이 순..
1. Initialize random index for minimum and maximum value. Anyhow it's gonna be updated. 2. To find the max and min element in an array, use Max and Min function. Example Code in Java public class Main{ public static void main(String args[]) { int arr[] = {2,4,3,7,5}; System.out.println(getMinMax(arr)); } public static int getMinMax(int[] arr) { //just set arbitrary index 0,1 for now int min = ar..
- Total
- Today
- Yesterday
- compareTo()
- HackerRank Algorithm
- hackerrank solution
- easy javascript algorithm
- substring()
- 프로그래머스
- algorithm
- hackerrank javascript solution
- hackerrank javascript
- ... in Javascript
- code refactoring
- string class in java
- Object type casting
- 프로그래머스 알고리즘문제
- hackerrank
- 알고리즘
- java
- repeat()
- easy algorithm
- 프로그래머스 알고리즘
- rest parameter
- C++
- math.max
- equals()
- spring boot application
- Collection Framework
- math.abs
- Javascript Algorithm
- HashMap
- javascript
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |