[Swift] Optimal Partition of String
Given a string s, partition the string into one or more substrings such that the characters in each substring are unique. That is, no letter appears in a sin...
Given a string s, partition the string into one or more substrings such that the characters in each substring are unique. That is, no letter appears in a sin...
Given the head of a linked list, remove the n$^t$$^h$ node from the end of the list and return its head.
Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that:
Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a s...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++’s atoi function).
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for bet...
Given an array of intervals where intervals[i] = [start$_i$, end$_i$], merge all overlapping intervals, and return an array of the non-overlapping intervals ...
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.