Skip to content

[Algorithm] 부족한 금액 계산하기 #84

Description

@hwangJi-dev

💬 문제

[코딩테스트 연습 - 부족한 금액 계산하기](https://school.programmers.co.kr/learn/courses/30/lessons/82612)


💬 풀이

func solution(price:Int, money:Int, count:Int)->Int64{letp=Int64((1...count).map({ $0 * price }).reduce(0,+))returnInt64(money)> p ?0: p - Int64(money)}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions