LeetCode 1716. Calculate Money in Leetcode Bank in F#
URL
Calculate Money in Leetcode Bank - LeetCode
Code
https://github.com/syohex/dotnet-study/tree/master/fsharp/leetcode/problems/1716/main.fsx
let totalMoney (n: int) : int =
let rec totalMoney' i n acc =
if i >= n then
acc
else
let acc' = acc + (i % 7 + 1) + (i / 7)
totalMoney' (i + 1) n acc'
totalMoney' 0 n 0