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

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)
  • 방명록

Algorithms (54)
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
Birthday Cake Candles

Problem You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out. For example, if your niece is turning 4years old, and the cake will have 4candles of height 4,4,1,3 ..

Algorithms 2020. 8. 16. 21:23
Mini-Max Sum

Problem Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers. Example let arr = [1, 3, 5, 7, 9] The minimum sum is 1 + 3 + 5 + 7 = 16 and the maximum sum is 3 + 5 + 7 + 9 = 24. The function prints 16 24 Soluti..

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

Blog is powered by Tistory / Designed by Tistory

티스토리툴바