본문 바로가기

리트코드4

[LeetCode/MSSQL] 1327. List the Products Ordered in a Period 문제링크 1327. List the Products Ordered in a Period https://leetcode.com/problems/list-the-products-ordered-in-a-period/description/?envType=study-plan-v2&envId=top-sql-50 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이과정 생.. 2024. 1. 28.
[leetcode/JS] 234. Palindrome Linked List / Javascript 문제링크 https://leetcode.com/problems/merge-two-sorted-lists/ Merge Two Sorted Lists - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 생각정리 기억하면 좋을 것 1. 두 list를 비교 후 남은 node 처리 할 때 crt.next = list1 || list2 이렇게 깔끔하게 처리 해줄 수 있다. 2. crt.next 를 지정 해 준 후 crt = crt.next 로 다음 노드로 이동 해 주어야 한.. 2022. 8. 27.
[leetcode/JS] 234. Palindrome Linked List / Javascript 문제링크 https://leetcode.com/problems/palindrome-linked-list/ Palindrome Linked List - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 기억하면 좋을 것 배열의 순서를 정반대로 뒤바꾸고 싶을때 어떻게 할까 ? 바로 reverse 배열 내장 함수를 사용하면 된다. 그런데 문자열을 정반대로 바꾸어 주고 싶다면 ? split() reverse() join() 세가지를 기억하자 split('') 은 문자열을 .. 2022. 8. 25.
[leetcode] 20. Valid Parentheses / JS Javascript 코드 , 풀이 문제 제목 Valid Parentheses 문제 링크 https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 코드 /** * @param {string} s * @return {boolean} */ var isValid = function(s) { let A = [s[s.length-1]]; for (let i =s.length-2; i>=0; i-.. 2022. 4. 6.