본문 바로가기

개발하기좋은날

검색하기
개발하기좋은날
프로필사진 devbi

  • 분류 전체보기 (66)
    • LIFE (5)
      • 건강,다이어트 (1)
      • 경제,금융 (4)
    • iOS (16)
      • Development (11)
      • Tip (5)
    • Algorithm (9)
    • BlockChain (33)
    • 회고록 (3)
Guestbook
반응형
Notice
  • 2020.11.02 개발인생시작
Recent Posts
Recent Comments
Link
«   2025/10   »
일 월 화 수 목 금 토
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
Tags
  • viewcontroller
  • 알고리즘
  • PBFT
  • 블록체인
  • solidity
  • ios
  • 분산원장
  • .dsym
  • pow
  • Xcode
  • dsYM
  • 백준
  • 비트코인
  • Mining
  • DPOS
  • POS
  • 프로그래머스
  • 재진입공격
  • view 이동
  • 암호화폐
  • ethereum
  • 블록체인 기술
  • Algorithm
  • 이더리움
  • Report
  • DEFI
  • Blockchain
  • reentrancy
  • External Call
  • Crash
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록largestProductOfThree (1)

개발하기좋은날

largestProductOfThree

정수를 요소로 갖는 배열을 입력받아 3개의 요소를 곱해 나올 수 있는 최대값을 리턴 조건 입력의 배열은 음수와 0을 포함하는 정수 입력의 배열 길이는 3이상 입력의 배열은 중첩되지 않은 1차원 배열 조합을 이용한 풀이 const largestProductOfThree = function (arr) { var com = combination(arr,3) com = com.map((v) => { return v.reduce((acc, cur) => acc * cur); }); return Math.max.apply(null, com); }; function combination(arr, selectNum) { const result = []; if (selectNum === 1) return arr.map(..

Algorithm 2022. 6. 2. 14:10
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바