Algorithms

Connecting Cities At Minimum Cost

There are N cities. You are given an array of connections. Each connection describes the cost of connecting one city to another. Return the minimum cost required to ensure that every pair of cities is connected by a path of connections.

Read
Algorithms

Maximum Profit from K Transactions

You have an array for which the i-th element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most k transactions.

Read
Algorithms

Partitioning an Array into K Equal Sum Subsets

Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal.

Read
Algorithms

Reversing Linked List Nodes in Groups of K

Reverse the nodes of a linked list, k at a time, and return the modified list.

Read
Algorithms

Longest Non-Contiguous, Non-Decreasing Subsequence

Find the longest non-contiguous, non-decreasing subsequence in an array of numbers.

Read
Algorithms

Maximum Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

Read
Algorithms

Minimum Palindromic Partitions

Given a string, split it into as few strings as possible such that each string is a palindrome.

Read
Algorithms

Merging Binary Search Trees

Merge two binary search trees into a single binary search tree.

Read