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

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

cut the sticks hackerrank (1)
Cut the sticks

간단하게는 minimum value 로 each index를 subtract할 수 있는 갯수를 구하는 문제. Solution 1 in Javascript const arr = [5, 3, 2, 2, 2, 8] function cutTheSticks(arr) { //sort the array let sorted = arr.sort(); //set index[0] to a min let min = sorted[0]; console.log(sorted.length); for (let i = 0; i min) { min = sorted[i]; //change min to next shortest min console.log(sorted.le..

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

티스토리툴바