You are climbing a staircase with n steps. It takes n steps to reach the top. Each time you can either climb 1 or…
Browsing: Data Structures & Algorithms
Given a non-negative integer n, your task is to find the nth Fibonacci number. The Fibonacci sequence is a sequence where the next term is the…
Consider a rat placed at position (0, 0) in an n x n square matrix mat[][]. The rat’s goal is to reach the…
The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an…
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any…
Find all valid combinations of k numbers that sum up to n such that the following conditions are true: Return a list of all possible…
Given a array arr of integers, return the sums of all subsets in the list. Return the sums in any order. Here’s…
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers…
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the…
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Here’s the [Problem Link] to begin with. Example…