본문 바로가기 메뉴 바로가기

Studying programming

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Studying programming

검색하기 폼
  • Jimin's Programming (194)
    • Algorithms (54)
    • JavaScript (16)
    • Vue.js (3)
    • Node.js (3)
    • React.js (7)
    • React Native (0)
    • Spring Boot (13)
    • JAVA (58)
    • C++ (17)
    • Programming (19)
    • Computer basics (4)
  • 방명록

HackerRank Algorithm (17)
Apple and Orange

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

Algorithms 2020. 8. 24. 22:05
Grading Students

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..

Algorithms 2020. 8. 22. 21:55
Time Conversion

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..

Algorithms 2020. 8. 22. 20:30
Staircase

Problem Observe that its base and height are both equal to n, and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces. Write a program that prints a staircase of size n. Solution function staircase(n) { for (let i = 1; i

Algorithms 2020. 8. 4. 20:00
Counting Valley

문제 난위도보다 영어해석과 문제 이해가 더 문제였던 문제;; Solution I in Java static int countingValleys(int n, String s) { int level = 0; int valley = 0; for(int i=0; i

Algorithms 2019. 8. 31. 13:04
이전 1 2 3 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • java
  • string class in java
  • spring boot application
  • substring()
  • repeat()
  • Object type casting
  • HackerRank Algorithm
  • rest parameter
  • compareTo()
  • javascript
  • hackerrank javascript solution
  • hackerrank
  • HashMap
  • easy javascript algorithm
  • Collection Framework
  • 프로그래머스
  • Javascript Algorithm
  • math.max
  • hackerrank javascript
  • ... in Javascript
  • code refactoring
  • hackerrank solution
  • C++
  • algorithm
  • math.abs
  • equals()
  • 프로그래머스 알고리즘
  • easy algorithm
  • 알고리즘
  • 프로그래머스 알고리즘문제
more
«   2025/11   »
일 월 화 수 목 금 토
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 29
30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바