Solution in JavaScript I const s = 7; const t = 10; const a = 4; const b = 12; const apples = [2, 3, -4]; const oranges = [3, -2, -4]; function countApplesAndOranges(s, t, a, b, apples, oranges) { let k = 0; let j = 0; let i; for (i = 0; i = s && a + apples[i] = s && b + oranges[i] value + a >= s && value + a value + b >= s && value + b
Solution in JavaScript const grades = [73, 67, 38, 33]; function gradingStudents(grade) { for (let i = 0; i = 38) { if (grade[i] % 5 === 3) { grade[i] += 2 } else if (grade[i] % 5 === 4) { grade[i] += 1 } } } return grade; } console.log(gradingStudents(grades)); //[ 75, 67, 40, 33 ] Reference https://www.hackerrank.com/challenges/grading/problem Grading Stude..
Solution in JavaScript const s = '07:05:45PM'; function TimeConversion(s) { // string을 바꿀 수 없으니 split을 사용해서 array로 바꿔준다. // AM과 PM도 삭제. '00:00:00AM' -> ['00', '00', '00'] //const arr = s.slice(0, 8).split(':'); const arr = s.split(':'); //indexOf(): 원하는 element의 index number return하고 원하는 index가 없으면 -1 return //PM 이 존재하면 최소 0 이니까 조건을 '> -1' 로 준다. //min 과 sec은 같고 시간 즉 arr[0]만 변화주면됨. arr[0] = (s.in..
- Total
- Today
- Yesterday
- math.max
- hackerrank javascript
- java
- substring()
- rest parameter
- easy algorithm
- 알고리즘
- hackerrank javascript solution
- Javascript Algorithm
- repeat()
- hackerrank solution
- equals()
- math.abs
- javascript
- Object type casting
- 프로그래머스
- easy javascript algorithm
- Collection Framework
- string class in java
- 프로그래머스 알고리즘
- hackerrank
- compareTo()
- algorithm
- spring boot application
- code refactoring
- HashMap
- HackerRank Algorithm
- ... in Javascript
- 프로그래머스 알고리즘문제
- C++
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |