본문 바로가기

분류 전체보기104

[LeetCode] 26. Remove Duplicates from Sorted Array 06.28.20240. Before We BeginI write my code even though my code is ridiculous as is the question just in case someone wonders what the heck is going on and why the judging seems odd.1. Problem2. My Code/** * @param {number[]} nums * @return {number} */var removeDuplicates = function(nums) { const s = new Set(nums); const result = [...s]; const k = nums.length; nums.length = 0; res.. 2024. 6. 28.
[LeetCode] 169. Majority Element 06.27.2024 1. Problem2. My Code/** * @param {number[]} nums * @return {number} */var majorityElement = function(nums) { var obj = Object(); nums.forEach((e) => { if (obj[e]) obj[e]++; else obj[e] = 1; }); let max = 0; Object.entries(obj).forEach((pair) => { const standard = parseInt(nums.length / 2); if (pair[1] > standard) max = pair[0]; }); .. 2024. 6. 27.
[JS] Array.prototype.sort()의 허점 06.20.20241. JavaScript Sort Method의 이상한 점JS를 쓰면서 sort를 사용해야 할 일이 있을 때 사실 빌트인 정렬 함수를 많이 쓰곤 했다.굳이 정렬 메소드를 재생성해야할 필요가 없었기 때문이다. 그런데 유데미 강의를 들으며 이상한 점을 알게되었다.["B", "C", "A"].sort();// ["A", B", "C"][6, 4, 15, 10].sort();// [10, 15, 4, 6] 자바스크립트에서는 이 코드가 동작하지 않는다는 것이다.분명 sort 메소드를 쓸 때 실행 오류를 한 번도 마주한 적이 없는데 이런 기본적인 함수에서 숫자가 정렬되지 않는다는게 믿겨지지가 않았다.2. Why?왜 자바스크립트의 정렬 함수는 숫자를 정렬하지 못하는 것일까?그 답은 공식 문서에서 찾.. 2024. 6. 20.
[IELTS] 아이엘츠 스피킹 재채점 성공 후기 및 2024 최신 정보 (British Council) 04.21.2024 1. 기존 점수 분석 및 설명 IELTS를 본 후 점수가 납득이 가지 않아 스피킹 부분만 재채점을 요청했고 스피킹 재채점에 성공했다. 기존 점수: Reading 8.0 Listening 7.5 Writing 6.5 Speaking 6.0 Overall 7.0 변동 점수: Reading 8.0 Listening 7.5 Writing 6.5 Speaking 7.0 Overall 7.5 6.5를 예상했었는데 예상치 못하게 7.0이 나와서 놀랐다. 0.5정도면 채점자 주관에 따라 바뀔 수 있고 조금 strict 했나보네.. 하는 정도이지만 1.0이면 굉장히 큰 폭이고 기존 채점관이 잘못했다! 라고 딱 말할 수 있는 범위이기 때문이다. 내가 6.0이라는 점수를 받고 왜 이렇게 화가났는지 이해가.. 2024. 4. 21.
[IELTS] Speaking Part 2/Part 3 (Drawing, Korean, Interesting Place, Party, Science, Cook) 04.13.2024 1. Drawing Part 2 Describe a drawing/painting that you like When you first saw this painting What the painting is about Who drew/painted it And explain why you like this drawing/painting Part 3 What are the differences between painting and drawing? Why do some people keep a painting for a long time? How does building style affect people's lives? Should children learn to draw and paint.. 2024. 4. 13.
[IELTS] Speaking Part 2 / Part 3 문제 모음 (Interesting Ideas, Interesting Person, Tiring Activity, Advice, Wait Long) 04.12.2024 1. Interesting Ideas Part 2 Describe a person who always has interesting ideas or opinions Who this person is What this person does How you knew him/her And explain why you think his/her ideas or opinions are interesting Part 3 When do you think children start to have their own opinions? Are children's opinions influenced by their parents? Who are likely to influence smart children? H.. 2024. 4. 12.