Given head, the head of a linked list, determine if the linked list has a cycle in it.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. Note that pos is not passed as a parameter.
Return true if there is a cycle in the linked list. Otherwise, return false.
Input: head = [3,2,0,-4], pos = 1
Output: true
Explanation: There is a cycle in the linked list, where the tail connects to the 1st node (0-indexed).
iTerm2에서 zsh을 사용하는데
어느순간부터 Tab 기능이 동작하지 않았다.
그러다보니 파일명 혹은 폴더명을 직접 다 타이핑해야하는 번거로움이 생겼다.
문제를 해결하기 위해 자료를 찾아본 결과
Completions stopped working after upgrading zsh 글을 참고하여 문제를 해결할 수 있었다.
Write a program to find the node at which the intersection of two singly linked lists begins.
You may assume there are no cycles anywhere in the entire linked structure.
Input: intersectVal = 8, listA = [4,1,8,4,5], listB = [5,6,1,8,4,5], skipA = 2, skipB = 3
Output: Reference of the node with value = 8
Input Explanation: The intersected node's value is 8 (note that this must not be 0 if the two lists intersect). From the head of A, it reads as [4,1,8,4,5]. From the head of B, it reads as [5,6,1,8,4,5]. There are 2 nodes before the intersected node in A; There are 3 nodes before the intersected node in B.
Given a non-empty array of decimal digits representing a non-negative integer, increment one to the integer.
The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit.
You may assume the integer does not contain any leading zero, except the number 0 itself.
Input: digits = [1,2,3]
Output: [1,2,4]
Explanation: The array represents the integer 123.
The count-and-say sequence is a sequence of digit strings defined by the recursive formula:
countAndSay(1) = "1"
countAndSay(n) is the way you would "say" the digit string from countAndSay(n-1), which is then converted into a different digit string.
To determine how you "say" a digit string, split it into the minimal number of groups so that each group is a contiguous section all of the same character. Then for each group, say the number of characters, then say the character. To convert the saying into a digit string, replace the counts with a number and concatenate every saying.
Input: n = 1
Output: "1"
Explanation: This is the base case.
MySQL DB에서 Json을 저장하였을 경우
해당 Json에 접근하여 데이터를 조작하는 SQL에 대해 알아본다.
ex) {“name”: “goodGid”, “money”: “1234”, “position”: “Back Dev”}