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..
주어진 x의 자릿수가 x의 자릿수의 합으로 나누어져야 한다. ex) x = 18 이면 1+8=9 이고 18/9의 나머지가 0이 되어야 함 입출력 예 10 true 12 true 11 false 13 false 1. x의 숫자를 문자형으로 변경한다 -> .toString(); ex) x=12345 -> x='12345' 2. 문자형으로 변경된 x를 개별의 숫자로 나눈다. -> .split(' '); ex) x='12345' -> x=['1','2','3','4','5']; 3. 개별로 나눈 숫자를 x의 길이만큼 더한다. 4. 더한 값을 정수로 변환 -> parseInt(); 5. x%(더한 값을 정수로 변환한 것) 이 0 이어야 true 리턴 function solution(x) { var answer =..
function solution(s){ // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. console.log('Hello Javascript') if(s==='pPoooyY'){ return true; }else if(s==='Pyy'){ return false; }else{ return true; } } 이런식으로 두서없이 풀다가...다른 사람이 푼 걸 보고 다시 풀었다 function solution(s){ let countP=0; let countY=0; // [실행] 버튼을 누르면 출력 값을 볼 수 있습니다. console.log('Hello Javascript') for(let i=0;i
- 고차함수
- debugger라도 해서 다풀어버리자
- 지뢰찾기 게임도 못하는데
- 배열단순값 객체엔 속성값
- 화살표함수에서 this의 바인딩
- var과 let의 차이
- 이 쉬운걸 4시간동안....
- .map
- MDN 참조
- 한번에 받는건 id로 받기
- 게임은 더못만든다
- 틀리면 말씀해주세요
- react 공식문서
- 생성자함수에서의 this
- if문 중첩없애기
- while문활용
- 모던자바스크립트
- 객체의 참조값
- removeEventListener
- 콜백함수에서의 this
- 중복숫자찾기
- .fill
- 복수는 한번에 안댐
- 1일차
- tcpschool
- 무조건 비공개..
- 무조곤 비공개
- 메서드오버라이드
- 문자열실수변경
- 프로토타입 체인
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |