codewars

Codewar-011 How Much?

↘锁芯ラ 提交于 2020-01-08 16:06:47
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> I always thought that my old friend John was rather richer than he looked, but I never knew exactly how much money he actually had. One day (as I was plying him with questions) he said: "Imagine I have between m and n Zloty (or did he say Quetzal? I can't remember!) If I were to buy 9 cars costing c each, I'd only have 1 Zlotty (or was it Meticals?) left. And if I were to buy 7 boats at b each, I'd only have 2 Ringglets (or was it Zlotty?) left. Could you tell me in each possible case: how much money f he could possibly have the cost c of a car the cost b of

codeWars in action(2014-05-06)

假如想象 提交于 2020-01-08 13:19:35
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 一、 Description: Write a small function that returns the values of an array that are not odd. All values in the array will be integers. Return the good values in the order they are given . my solution: function noOdds(values) { var arr = []; values.filter(function (val) { if (val % 2 === 0) { arr.push(val); } }); console.log(arr); return arr; } solution from web: function no_odds( values ){ // Return all non-odd values return values.filter(function(val){return val%2===0}) } 二、 Description: Fellow code warrior, we need your help! We seem to have lost one of