사랑하애오
close
프로필 배경
프로필 로고

사랑하애오

  • 분류 전체보기
    • 정보처리기사 기출문제
      • 2020년
    • AWS
    • HTML, CSS, Layout, Grid
    • JavaScript, JQuery
    • C++
    • Node.js
    • Linux
      • centosOS
    • BlockChain
      • 기술면접
      • 비트코인
      • 이더리움
    • VSCode
    • Network
    • Solidity
    • JAVA
      • SpringBoot
      • SpringBoot Shoppingmall
      • SpringBoot CRUD Board
      • Eclipse
    • MySQL
    • React.JS
      • Redux-Saga
    • 프로그래머스(Javascript)
      • Level 0
  • 홈
  • 태그
  • 방명록

[프로그래머스 | 자바스크립트] 겹치는 선분의 길이

솔루션 const solution = (lines) => { const answer = lines.reduce((a, [x, y]) => { for (let i = Math.min(x, y) + 1; i v > 1).length); return Object.values(answer).filter((v) => v > 1).length; }; 솔루션 const solution = (lines) => { let line = new Array(200).fill(0); lines.forEach(([a, b]) => { for (; a (c > 1 ? a + 1 : a), 0); console...

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 3. 2.
  • textsms

[프로그래머스 | 자바스크립트] 유한소수 판별하기

솔루션 const solution = (a, b) => { const getGCD = (a, b) => { let gcd = 1; for (let i = 1; i { let pFactors = []; for (let i = 2; i 2) pFactors = [...pFactors, num]; return pFactors; }; const answer = getPrimeFactors(b / getGCD(a, b)).find( (n) => n !== 2 && n !== 5 ) ? 2 : 1; console.log(answer); return answer; };

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 3. 2.
  • textsms

[프로그래머스 | 자바스크립트] 등수 매기기

솔루션 const solution = (score) => { const avgs = score.map(([a, b]) => (a + b) / 2); const avgRank = [...avgs] .sort((a, b) => b - a) .map((avg, i) => ({ avg, rank: i + 1 })) .map((a, i, arr) => i > 0 && a.avg === arr[i - 1].avg ? { ...a, rank: arr[i - 1].rank } : a ); console.log(avgRank); const answer = avgs.map( (_avg) => avgRank.find(({ avg }) => _avg === avg).rank ); console.log(answer); retu..

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 3. 1.
  • textsms

[프로그래머스 | 자바스크립트] 로그인 성공?

솔루션 const solution = (id_pw, db) => { const [id, pw] = id_pw; const answer = db.find(([_id, _pw]) => _id === id && _pw === pw) ? "login" : !db.find(([_id]) => _id === id) ? "fail" : "wrong pw"; console.log(answer); return answer; }; 솔루션 const solution = (id_pw, db) => { const [id, pw] = id_pw; const map = new Map(db); const answer = map.has(id) ? map.get(id) === pw ? "login" : "wrong pw" : "fail..

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 2. 28.
  • textsms

[프로그래머스 | 자바스크립트] 치킨 쿠폰

솔루션 const order = (chicken) => { if (chicken { const answer = order(chicken); console.log(answer); return answer; }; 솔루션 const solution = (chicken) => { let answer = 0; let coupon = chicken; while (coupon >= 10) { answer = answer + parseInt(coupon / 10); co..

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 2. 27.
  • textsms

[프로그래머스 | 자바스크립트] 특이한 정렬

솔루션 const solution = (numlist, n) => { const answer = numlist.sort((a, b) => { const [x, y] = [Math.abs(a - n), Math.abs(b - n)]; if (x === y) return b - a; return x - y; }); console.log("answer ", answer); return answer; };

  • format_list_bulleted 프로그래머스(Javascript)/Level 0
  • · 2023. 2. 26.
  • textsms
  • navigate_before
  • 1
  • 2
  • 3
  • 4
  • 5
  • ···
  • 8
  • navigate_next
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바