알고리즘 LOG/Codewars (3) 썸네일형 리스트형 [7kyu] Categorize New Member [7kyu] Categorize New Member 191112 7kyu 문제 ::: tip Q The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be placed. To be a senior, a member must be at least 55 years old and have a handicap greater than 7. In this croquet club, handicaps range from -2 t.. [7kyu] Printer Errors [7kyu] Printer Errors 191108 7kyu 문제 ::: tip Q In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are named with letters from a to m. The colors used by the printer are recorded in a control string. For example a "good" control string would be aaabbbbhaijjjm meaning that the printer used three times color a, four.. [8kyu] Sum of positive [8kyu] Sum of positive 191107 8kyu 문제 ::: tip Q You get an array of numbers, return the sum of all of the positives ones. Example [1,-4,7,12] => 1 + 7 + 12 = 20 Note: if there is nothing to sum, the sum is default to 0. 숫자 배열을 얻고 모든 양수의 합을 반환합니다. 예 [1, -4,7,12] => 1 + 7 + 12 = 20 참고 : 합계가없는 경우 합계는 기본적으로 0입니다. ::: answer function positiveSum(arr) { let sum = 0; arr.forEach( (value) => { if (value.. 이전 1 다음