This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css" /> | |
<style> | |
canvas { | |
width: 600px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
const chalk = require('chalk'); | |
const title = chalk.yellowBright | |
const dns = require('dns'); | |
const dnsPromises = dns.promises; | |
const net = require('net'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//동기, 비동기 기능 더 추가해서....다시 해보긔 | |
const EventEmitter = require("events"); | |
let chalk = require('chalk'); | |
let guide = chalk.blue; | |
let guide1 = chalk.bold.yellow; | |
let guide2 = chalk.inverse.blue; | |
class Cashier extends EventEmitter { | |
constructor() { | |
super(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function diagonalDifference(arr) { | |
let line1 = 0; | |
let line2 = 0; | |
for (let i = 0; i < arr.length; i++) { | |
line1 += arr[i][i]; | |
line2 += arr[i][arr.length - 1 - i]; | |
} | |
let sum = Math.abs(line1 - line2); | |
return sum; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//크레인 인형뽑기 | |
function solution(board, moves) { | |
var answer = 0; | |
let basket = [0]; //처음에 비교할 기본값을 미리 넣어준다. | |
while (moves.length > 0) { | |
let move = moves.shift(); | |
for (let line = 0; line < board.length; line++) { | |
if (board[line][move - 1] !== 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
log | |
} = console; | |
const pipe = (...funcs) => v => { | |
return funcs.reduce((res, func) => { | |
return func(res); | |
}, v); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#CLASS, #OBJECT, #Set(), #super #extends | |
let { | |
log | |
} = console; | |
//*도형 생성자$프로토타입 | |
//직선길이 | |
class Straight { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ListNode(val, next) { | |
this.val = (val === undefined ? 0 : val) | |
this.next = (next === undefined ? null : next) | |
} | |
var deleteDuplicates = function (head) { | |
let curr = head; | |
//head and next exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ | |
class Node { | |
constructor(data, next = undefined) { | |
this.data = data; | |
this.next = next; | |
} | |
} | |
class LinkedList { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require("readline"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
let input = []; | |
rl.on("line", function (line) { |
NewerOlder