반응형
https://school.programmers.co.kr/learn/courses/30/lessons/120910
파이썬
def solution(n, t):
return n*(2**t)
자바
class Solution {
public int solution(int n, int t) {
int answer = 0;
answer = n * (int)(Math.pow(2,t));
return answer;
}
}
자바스크립트
function solution(n, t) {
var answer = 0;
answer = n * 2**t;
return answer;
}
반응형
'Portpolio > codingtest' 카테고리의 다른 글
프로그래머스 마지막 두 원소 구하기 (0) | 2025.02.03 |
---|---|
프로그래머스 옷가게 할인 받기 풀이 (0) | 2025.02.03 |
프로그래머스 몫 구하기 (0) | 2025.02.02 |
프로그래머스 닉네임규칙 풀이 (0) | 2025.02.02 |
프로그래머스 Lv0. 제곱수 판별하기 (0) | 2025.01.08 |
댓글