■ 문제 원본 사이트: https://www.hackerrank.com/challenges/minimum-swaps-2/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays Minimum Swaps 2 | HackerRank Return the minimum number of swaps to sort the given array. www.hackerrank.com 난이도: Medium 최대 스코어: 40 ● 문제 요약 중복되지 않은 연속된 정수들 [1, 2, 3, ..., n]로 구성된 정렬되지 않음 배열이 제공됨 두 요소를 교환할 수 있음 (swap. 스왑) 배열을 오름차순으로 정렬하..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/sherlock-and-valid-string/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=strings Sherlock and the Valid String | HackerRank Remove some characters from the string such that the new string's characters have the same frequency. www.hackerrank.com 난이도: Medium 최대 스코어: 35 ● 문제 요약 문자열 s가 주어짐 한 개의 문자는 제거 가능 모든..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/ctci-making-anagrams/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=strings Strings: Making Anagrams | HackerRank How many characters should one delete to make two given strings anagrams of each other? www.hackerrank.com 난이도: Easy 최대 스코어: 25 ● 문제 요약 첫 번째 문자열의 문자를 재배열하여 두 번째 문자열을 형성할 수 있는 경우 두 문자열은 서로의 애..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/alternating-characters/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=strings Alternating Characters | HackerRank Calculate the minimum number of deletions required to convert a string into a string in which consecutive characters are different. www.hackerrank.com 난이도: Easy 최대 스코어: 20 ● 문제 요약 문자 'A' 또는 ..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/ctci-bubble-sort/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=sorting Sorting: Bubble Sort | HackerRank Find the minimum number of conditional checks taking place in Bubble Sort www.hackerrank.com 난이도: Easy 최대 스코어: 30 ● 문제 요약 > 기본 버블 정렬 for (int i = 0; i < n; i++) { for (int j = 0; j < n - 1; j++) { /..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/fraudulent-activity-notifications/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=sorting Fraudulent Activity Notifications | HackerRank Print the number of times a customer receives a notification www.hackerrank.com 난이도: Medium 최대 스코어: 40 ● 문제 요약 특정 날짜에 고객이 지출한 금액이 이전의 일정 날짜동안 평균적(median 값으로 정함)으로 지출한 금..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/mark-and-toys/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=sorting Mark and Toys | HackerRank You are Mark's best friend and have to help him buy as many toys as possible. www.hackerrank.com 난이도: Easy 최대 스코어: 35 ● 문제 요약 Mark는 아들을 위한 장난감을 사고 싶어함 Mark가 지출할 수 있는 금액은 정해져있음 최대한 많은 수의 장난감을 사려고 함 장난감 가격 목록(p..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/new-year-chaos/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays New Year Chaos | HackerRank Determine how many bribes took place to get a queue into its current state. www.hackerrank.com 난이도: Medium 최대 스코어: 40 ● 문제 요약 새해 첫 날 사람들은 롤러코스터를 타기 위해 줄을 서 있는 상태 사람들은 모두 1부터 n까지의 queue에서 자신의 초기 위치를 나타내는 스티커를..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/ctci-array-left-rotation/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays Arrays: Left Rotation | HackerRank Given an array and a number, d, perform d left rotations on the array. www.hackerrank.com 난이도: Easy 최대 스코어: 20 ● 문제 요약 Left Rotation(왼쪽 회전): 배열의 각 요소를 왼쪽으로 1칸씩 이동한 것 n 개의 정수로 구성된 배열 a와 숫자 d가..
■ 문제 원본 사이트: https://www.hackerrank.com/challenges/2d-array/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays 2D Array - DS | HackerRank How to access and use 2d-arrays. www.hackerrank.com 난이도: Easy 최대 스코어: 15 ● 문제 요약 6 X 6 배열이 주어짐 hourglass(모래시계)는 I 모양으로 이루어진 패턴에 해당하는 인덱스들의 하위집합을 의미 hourglass sum은 hourglass(모래시계) 값들의 합계 모든 hourglass(모래시계)에 대한 hourg..
function getMedian(arr) { // arr.sort((a, b) => { return a - b; }); console.log('arr=', arr); const max = arr.reduce((acc, cur, idx) => { if(arr[idx] > acc){ acc = arr[idx]; } return acc; }, 0); let counts = []; for(let i=0; i
Array.reduce() ● 기본 정리 배열의 각 요소에 대해 주어진 리듀서(reducer) 함수를 실행하고, 하나의 결과값을 반환합니다. arr.reduce(callback[, initialValue]) callback : 배열의 각 요소에 대해 실행할 함수. 다음 네 가지 인수를 가짐 accumulator : 누산기. 콜백의 반환값을 누적. 콜백의 이전 반환값 또는, 콜백의 첫 번째 호출이면서 initialValue를 제공한 경우에는 initialValue의 값임 currentValue : 처리할 현재 요소 currentIndex (Optional) : 처리할 현재 요소의 인덱스. initialValue를 제공한 경우 0, 아니면 1부터 시작 array (Optional) : reduce()를 호출..
Array의 요소(element)를 swap하는 방법 Array에서 두 요소(element)를 서로 바꾸고 싶을 경우, swap을 해야 하는데 javascript에는 별도의 swap 메서드가 없기 때문에 직접 사용해야 한다. 예를 들어, arr = [1, 2, 3, 4, 5] 배열에서 arr[1]과 arr[2]의 값을 서로 바꿔 [1, 3, 2, 4, 5]가 되도록 만들어보자. ● temp 변수 사용 가장 기본적인 방법이 temp 변수를 사용하는 것이다. const arr = [1, 2, 3, 4, 5]; let temp = arr[1]; arr[1] = arr[2]; arr[2] = temp; console.log(arr); // [1, 3, 2, 4, 5] ● 구조 분해 할당 사용 구조 분해 할당 구..
문제 원본 사이트 : programmers.co.kr/learn/courses/30/lessons/42587?language=javascript 코딩테스트 연습 - 프린터 일반적인 프린터는 인쇄 요청이 들어온 순서대로 인쇄합니다. 그렇기 때문에 중요한 문서가 나중에 인쇄될 수 있습니다. 이런 문제를 보완하기 위해 중요도가 높은 문서를 먼저 인쇄하는 프린 programmers.co.kr 문제 설명 일반적인 프린터는 인쇄 요청이 들어온 순서대로 인쇄합니다. 그렇기 때문에 중요한 문서가 나중에 인쇄될 수 있습니다. 이런 문제를 보완하기 위해 중요도가 높은 문서를 먼저 인쇄하는 프린터를 개발했습니다. 이 새롭게 개발한 프린터는 아래와 같은 방식으로 인쇄 작업을 수행합니다. 1. 인쇄 대기목록의 가장 앞에 있는 ..
Array.some() 기본 정리 some() 메서드는 배열 안의 어떤 요소라도 주어진 판별 함수를 통과하는지 테스트합니다. arr.some(callback[, thisArg]) 매개변수 callback : 각 요소를 시험할 함수. 다음 세 가지 인수를 받습니다. currentValue : 처리할 현재 요소 index (Optional) : 처리할 현재 요소의 인덱스 array (Optional) : some을 호출한 배열 thisArg (Optional) : callback을 실행할 때 this로 사용할 값 반환값 callback이 어떤 배열 요소라도 대해 참인(truthy) 값을 반환하는 경우 true, 그 외엔 false. ※ 빈 배열에서 some()을 호출하면 무조건 false를 반환합니다. 사용..
- Total
- Today
- Yesterday
- DOCs
- 블록 체인
- 블록체인
- Blockchain
- 빅데이터 기초
- 하이퍼레저 페브릭
- 코테
- codility
- Private Data
- 빅데이터
- 알고리즘
- 어서와 데이터는 처음이지
- ubuntu
- 문제풀이
- 암브로셔스
- 빅데이터 교육
- Hyperledger Fabric v1.1
- Hyperledger Indy
- 하이퍼레저 인디
- ambrosus
- 코딩테스트
- 기초 of 기초 데이터 개념
- docker
- Hyperledger Fabric
- Hyperledger Fabric v1.2
- javascript
- 하이퍼레저 패브릭
- 빅데이터 강의
- 코딜리티
- 직딩잇템
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |