일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 배열
- select
- 코딩공부
- array
- MySQL
- 코플릿
- 코드스테이츠
- 최강의 인생
- array.push()
- Hackerrank
- Where
- 정규표현식
- JavaScript
- 재귀함수
- 자바스크립트
- for문
- 알고리즘
- 블록체인
- Algorithms
- 역행자
- Programmers
- 개발자의 책장
- 코딩테스트
- Developer_JoyKim
- SQL
- node.js
- join
- 개발자_조이킴
- 프로그래머스
- array.slice()
- Today
- Total
목록array (29)
CodingSpace
Problem. Warmup - Plus Minus Link. https://www.hackerrank.com/challenges/plus-minus/problem?isFullScreen=true Diagonal Difference | HackerRank Calculate the absolute difference of sums across the two diagonals of a square matrix. www.hackerrank.com Description. Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each ..
Problem. Warmup - Diagonal Difference Link. https://www.hackerrank.com/challenges/diagonal-difference/problem?isFullScreen=true A Very Big Sum | HackerRank Calculate the sum of the values in an array that might exceed the range of int values. www.hackerrank.com Description. Given a square matrix, calculate the absolute difference between the sums of its diagonals. Key Point. My Answer. 'use stri..
Problem. Warmup - A Very Big Sum Link. https://www.hackerrank.com/challenges/a-very-big-sum/problem?isFullScreen=true Solve Me First | HackerRank This is an easy challenge to help you start coding in your favorite languages! www.hackerrank.com Description. In this challenge, you are required to calculate and print the sum of the elements in an array, keeping in mind that some of those integers m..
Problem. createPhoneNumber Description. 0-9 사이의 정수를 요소로 갖는 배열을 입력받아 전화번호 형식의 문자열을 리턴하는 함수를 작성하시오. ※ 배열의 길이가 8인 경우, 앞에 [0, 1, 0]이 있다고 가정 & for, while문 사용금지 예) 입력: arr = [8, 7, 6, 5, 4, 3, 2, 1] → 출력: '(010)8765-4321' 입력: 인자1: arr number 타입을 요소로 갖는 배열 arr[i]는 0 이상 9 이하의 정수 배열의 길이는 8 또는 11 출력: string 타입을 반환 My Answer. function createPhoneNumber(arr) { let front = '(010)' let middle = '' let back = ..
Problem. getAllElementsButNth Description. 배열과 인덱스를 입력받아 해당 인덱스의 요소를 제외한 배열을 리턴하는 함수를 작성하시오. ※ 배열의 길이보다 큰 인덱스를 입력받은 경우, 입력받은 배열 그대로 반환 입력: 인자1: arr 임의의 요소를 갖는 배열 인자2: n number 타입의 인덱스 출력: 인덱스에 해당하는 요소를 제외한 배열을 반환 My Answer. function getAllElementsButNth(arr, n) { if(n > arr.length) return arr; arr.splice(n, 1); return arr; } Comments. 코드스테이츠 저작권으로 문제가 된다면 본 게시물 비공개로 처리하겠습니다! SEB IM 34기 수료생
Problem. addToFrontOfNew Description. 배열과 요소를 입력받아 맨앞에 새로운 요소가 추가된 새로운 배열을 리턴하는 함수를 작성하시오. 입력: 인자1: arr 임의의 요소를 갖는 배열 인자2: el 임의의 값인 요소 출력: 배열 맨앞에 새로운 요소를 추가한 새로운 배열을 반환 My Answer. function addToFrontOfNew(arr, el) { let newArr = arr.slice(); newArr.unshift(el); return newArr; } Comments. 코드스테이츠 저작권으로 문제가 된다면 본 게시물 비공개로 처리하겠습니다! SEB IM 34기 수료생
Problem. addToBackOfNew Description. 배열과 요소를 입력받아 새로운 요소가 추가된 새로운 배열을 리턴하는 함수를 작성하시오. 입력: 인자1: arr 임의의 요소를 갖는 배열 인자2: el 임의의 타입 출력: 새로운 요소가 추가된 새로운 배열을 반환 My Answer. function addToBackOfNew(arr, el) { let newArr = arr.slice(); newArr.push(el); return newArr; } Comments. 코드스테이츠 저작권으로 문제가 된다면 본 게시물 비공개로 처리하겠습니다! SEB IM 34기 수료생
Problem. removeFromBackOfNew Description. 배열을 입력받아 배열의 마지막 요소가 제외된 새로운 배열을 리턴하는 함수를 작성하시오. 입력: 인자1: arr 임의의 요소를 갖는 배열 출력: 배열의 마지막 요소를 삭제된 새로운 배열을 반환 My Answer. function removeFromBackOfNew(arr) { let newArr = arr.slice(0, arr.length -1); return newArr; } Comments. 코드스테이츠 저작권으로 문제가 된다면 본 게시물 비공개로 처리하겠습니다! SEB IM 34기 수료생