Mar 10, 2026
There are n computers numbered 0 to n-1 connected by cables. connections[i] = [a, b] means a cable connects computers a and b. You can remove an existing cable and...
leetcodemediumgraphdsu
Mar 10, 2026
Given the head of a singly linked list, return the middle node. If there are two middle nodes, return the second middle node.
leetcodeeasylinked-listtwo-pointers
Mar 9, 2026
You are given a string s and an array of index pairs pairs where pairs[i] = [a, b] indicates you can swap the characters at indices a and b any...
leetcodemediumstringgraphdsu
Mar 8, 2026
You are given an array points where points[i] = [xi, yi] represents a point on the 2D plane. The cost to connect two points is the Manhattan distance: |xi -...
leetcodemediumgraphmstdsu
Mar 7, 2026
We can “shift” a string by shifting each character to its successive character (with z wrapping to a). For example, "abc" can be shifted to "bcd", …, "xyz", "yza", "zab"....
leetcodemediumstringhash
Mar 7, 2026
Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine. Each letter in magazine can only be used once.
leetcodeeasystringhash
Mar 7, 2026
Given two strings s and t, return true if t is an anagram of s, and false otherwise. An anagram uses the exact same characters with the exact same frequencies....
leetcodeeasystringhash
Mar 7, 2026
Given an integer array nums and an integer k, return true if there are two distinct indices i and j such that nums[i] == nums[j] and abs(i - j) <=...
leetcodeeasyarrayhashsliding-window
Mar 7, 2026
Given an integer array nums, return true if any value appears at least twice, and false if every element is distinct.
leetcodeeasyarrayhash
Mar 6, 2026
Given the root of a binary tree and an integer targetSum, return all root-to-leaf paths where the sum of the node values equals targetSum. Each path should be returned as...
leetcodemediumtreedfsbacktracking