본문 바로가기
코딩테스트/LV. 0

LV. 0 :: 주사위의 개수

by KUROMI98 2023. 1. 20.

https://school.programmers.co.kr/learn/courses/30/lessons/120845

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

function solution(box, n) {
    var answer = Math.floor(box[0]/n) * Math.floor(box[1]/n) * Math.floor(box[2]/n);
    return answer;
}

+)230510

const solution = (box, n) => {
    return Math.floor(box[0]/n) * Math.floor(box[1]/n) * Math.floor(box[2]/n);
}

230525

def solution(box, n): 
    return (box[0]//n) * (box[1]//n) * (box[2]//n)

230915 C++

#include <string>
#include <vector>

using namespace std;

int solution(vector<int> box, int n) { 
    return (box[0]/n) * (box[1]/n) * (box[2]/n);
}

'코딩테스트 > LV. 0' 카테고리의 다른 글

LV. 0 :: 외계행성의 나이  (0) 2023.01.20
LV. 0 :: 자릿수 더하기  (0) 2023.01.20
LV. 0 :: 세균 증식  (0) 2023.01.20
LV. 0 :: 개미 군단  (0) 2023.01.20
LV. 0 :: 최댓값 만들기 1  (0) 2023.01.20

댓글