0
点赞
收藏
分享

微信扫一扫

收藏,安装报错信息汇总,MacOS上安装Adobe等软件/插件报错问题解决合集

Soy丶sauce 2023-10-22 阅读 52

【Edabit 算法 ★☆☆☆☆☆】 Basketball Points

language_fundamentals math numbers

Instructions
Examples
points(1, 1) // 5
points(7, 5) // 29
points(38, 8) // 100
Notes
  • N/A
Solutions
function points(twoPointers, threePointers) {
    return twoPointers * 2 + threePointers * 3 ;
}

TestCases
let Test = (function(){
    return {
        assertEquals:function(actual,expected){
            if(actual !== expected){
                let errorMsg = `actual is ${actual},${expected} is expected`;
                throw new Error(errorMsg);
            }
        }
    }
})();

Test.assertEquals(points(1, 1), 5)
Test.assertEquals(points(1, 2), 8)
Test.assertEquals(points(2, 1), 7)
Test.assertEquals(points(2, 2), 10)
Test.assertEquals(points(69, 420), 1398)
举报

相关推荐

0 条评论