
문제 설명0과 1로 이루어진 어떤 문자열 x에 대한 이진 변환을 다음과 같이 정의합니다. x의 모든 0을 제거합니다.x의 길이를 c라고 하면, x를 "c를 2진법으로 표현한 문자열"로 바꿉니다.예를 들어, x = "0111010"이라면, x에 이진 변환을 가하면 x = "0111010" -> "1111" -> "100" 이 됩니다. 0과 1로 이루어진 문자열 s가 매개변수로 주어집니다. s가 "1"이 될 때까지 계속해서 s에 이진 변환을 가했을 때, 이진 변환의 횟수와 변환 과정에서 제거된 모든 0의 개수를 각각 배열에 담아 return 하도록 solution 함수를 완성해주세요. 입출력 예 설명"110010101001"이 "1"이 될 때까지 이진 변환을 가하는 과정은 다음과 같습니다. 문제 풀이 방법..
Create a class ArrayWrapper that accepts an array of integers in its constructor. This class should have two features: When two instances of this class are added together with the + operator, the resulting value is the sum of all the elements in both arrays.When the String() function is called on the instance, it will return a comma separated string surrounded by brackets. For example, [1,2,3]. ..
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one's added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + II. Roman numerals are usually written largest to smallest from left to right. Howeve..
Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not. 현재 숫자를 거꾸로 해서 현재 숫자와 값이 같으면 true를 반환, 다르면 false를 반환하는 예제이다 var isPalindrome = function(x) { const stringX = String(x).split("").reverse().join(""); if (x === parseInt(stringX)) { return true; } return false; }; 먼저 x를..
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. 아래 문제가 내가 푼 답이다 (시간복잡도를 고려하지 않고 푼 문제..하지만 문제를 보면 O(log n)으로 풀라고 작성되어있다.) var searchInsert = function(nums, target) { const numsArray = [...nums]; if (numsArray...
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements..
- 문자열실수변경
- 이 쉬운걸 4시간동안....
- 메서드오버라이드
- 화살표함수에서 this의 바인딩
- 지뢰찾기 게임도 못하는데
- 객체의 참조값
- MDN 참조
- 콜백함수에서의 this
- var과 let의 차이
- refresh token
- 중복숫자찾기
- 한번에 받는건 id로 받기
- 타입스크립트 프로그래밍
- .fill
- if문 중첩없애기
- NextJS13
- 프로토타입 체인
- while문활용
- 생성자함수에서의 this
- login연장
- httponly cookie
- react 공식문서
- 무조건 비공개..
- 게임은 더못만든다
- 틀리면 말씀해주세요
- 무조곤 비공개
- 배열단순값 객체엔 속성값
- 복수는 한번에 안댐
- https://www.ncloud.com/support/notice/all/1424
- debugger라도 해서 다풀어버리자
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |