def solution(n):
    answer = 0
    F = [0, 1]
    
    for i in range(n-1):
        F.append(F[i] + F[i+1])
        
    answer = F[n] % 1234567
    return answer

def solution(n, lost, reserve):
    answer = 0
    total = list()
    
    for i in range(n):
        total.append(1)
    
    for i in lost:
        total[i-1] -= 1
    
    for i in reserve:
        total[i-1] += 1 
  
    for i in range(len(total)):
        if total[i] == 2:
            if i-1 >= 0:
                if total[i-1] == 0:
                    total[i-1] += 1
                    total[i] -= 1
        if total[i] == 2:
            if i+1 < len(total):
                if total[i+1] == 0:
                    total[i+1] += 1
                    total[i] -= 1
                    
    for student in total:
        if student >= 1:
            answer += 1
                    
    return answer

import datetime
def solution(a, b):
    answer = {0 : "MON", 1 : "TUE", 2 : "WED", 3 : "THU", 4 : "FRI", 5 : "SAT", 6 : "SUN"}
    dt = datetime.datetime(2016, a, b)
    return answer[dt.weekday()]

def solution(n):
    answer = list()
    for i in list(str(n)):
        answer.append(i)
    a = sorted(answer)[::-1]
    stra = "".join(a)
    return int(stra)

+ Recent posts