LeetCode: 938-Range Sum of BST 解題紀錄
題目
Given theRead More »LeetCode: 938-Range Sum of BST 解題紀錄root
node of a binary search tree and two integerslow
andhigh
, return the sum of values of all nodes with a value in the inclusive range[low, high]
.
Given theRead More »LeetCode: 938-Range Sum of BST 解題紀錄root
node of a binary search tree and two integerslow
andhigh
, return the sum of values of all nodes with a value in the inclusive range[low, high]
.
The power of the string is the maximum length of a non-empty substring that contains only one unique character. Given a string s, return the power of s.Read More »LeetCode: 1446-Consecutive Characters
Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.
Return the decimal value of the number in the linked list.
Read More »LeetCode: 1290-Convert Binary Number in a Linked List to IntegerThe Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, return the Hamming distance between them.Read More »LeetCode: 461-Hamming Distance 解題紀錄
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.)
Read More »LeetCode: 24-Swap Nodes in Pairs 解題紀錄You are given an array of k
linked-lists lists
, each linked-list is sorted in ascending order.