You are on page 1of 13

CIS 675 — Asif Salekin

due nov 27, 2020 at 11:59 pm est via Problem Set-1

problem 1 Recurrence

Consider the recurrence T (n) = 2T (n/2) + f (n) in which


 3
n if dlog(n)e is even
f (n) =
n2 otherwise

Show that f (n) = Ω(nlogb (a)+e ). Explain why the third case of the Master’s theo-
rem stated above does not apply. Prove a Θ-bound for the recurrence.

problem 2 Divide and Conq 1

Suppose that you are given an array A of size n containing real numbers. How-
ever, although A has n elements, it only has k distinct values (so numbers appear
multiple times), where k ∼ log log n (this means that asymptotically, k is approx-
imately log log n). In class we saw how to sort an array of size n in O(n log n)
time; show how you can sort A in better than O(n log n) time.

You are allowed to create additional arrays to help you, but do not use more
complex data structures, such as heaps, queues, etc. Describe the algorithm and
analyze its running time.

problem 3 Divide and Conq 2

A binary tree is a tree in which every node has 0, 1, or 2 children. Design a re-
cursive algorithm to find the maximum depth of a binary tree (the depth is the
length of the longest path from the root to a leaf of the tree). Analyze the running
time of this algorithm. For what tree does it perform the worst?

problem 4 Divide and Conq 3

You are given a zero-indexed array A of length n. Each value in this array is equal
to 1: i.e., A = [1, 1, 1, ..., 1]. However, you do not know what the value of n is.
You are allowed to access an element i of the array by calling A[i ]. If i < n, this
will return 1, and if i ≥ n, this will return a message saying that the location does
not exist (you can think of this as an error message, but it will not crash your
program). Present an algorithm to find the value of n. Your algorithm should run
in better of O(n) time.
What is the running time of your algorithm?
problem 5 Divide and Conq 4

Suppose that you are given an unsorted array A of length n, in which all values are
different real numbers. A local minimum of A is an index i such that A[i ] < A[i + 1]
and A[i ] < A[i − 1] (if i is the first or last element of A, then it need only be less
than the single adjacent element). In other words, A[i ] is less than all adjacent
values in A.

Create an efficient algorithm for finding a local minimum in better than O(n)
time. Note that you don’t need to return all local minima- just one.

(Hint: Suppose you split the array in half, and compare the two boundary
elements A[ j] and A[ j + 1]. If A[ j] < A[ j + 1], on which side are you guaranteed to
find a local minimum? What if A[ j + 1] < A[ j]? Why?)

Prove that your algorithm is correct, and analyze its running time.

problem 6 Divide and Conq 5

You are interested in finding the median salary in Syracuse City. The city has two
towns, Happyville and Sadtown. Each town maintains a database of all of the
salaries for that particular town, but there is no central database. Each town has
given you the ability to access their particular data by executing queries. For each
query, you provide a particular database with a value k such that 1 ≤ k ≤ n, and
the database returns to you the kth smallest salary in that town. You may assume
the following:

• Each town has exactly n residents (so 2 × n total residents across both towns)

• Every salary is unique (i.e., no two residents, regardless of town, have the
same salary)

• We define the median as the nth highest salary across both towns.

(a) Design an algorithm that finds the median salary across both towns in
θ (log(n)) total queries.
(b) Prove that the algorithm finds the correct answer.

problem 7 Divide and Conq 6

You are given an array A of distinct integers, sorted in decreasing order. We want
to determine if there is any index i such that A[i ] = i (assume the indexing starts
at 0). Design an efficient divide-and-conquer algorithm to solve this. What is its
running time? Explain your answer.

problem 8 Divide and Conq 7

Problem Set-1-2
Given a list of closing stock ticker prices p1 , p2 , . . . , pn , devise an O(n2 ) algorithm
that finds the longest (not necessarily consecutive) streak of prices that increase
or stays the same. For example, given the prices 2, 5, 2, 6, 3, 3, 6, 7, 4, 5, there is the
streak 2, 5, 6, 6, 7 of prices that increase or stay the same, but an even longer streak
is 2, 2, 3, 3, 4, 5.
(Challenge: by using both dynamic programming and binary search, you can
solve this problem in O(n log n) time.)

problem 9 Recurrence 1

A zookeeper has 2 lions and n rooms that the lions could potentially be placed in.
The n rooms are in one row (like on a number line). The lions cannot be placed
in the same room or in adjacent rooms. For example, if there are three rooms,
one way to place the lions is: <Lion 1><empty room><Lion 2>. However, the
placement <empty room><Lion 1><Lion 2> would not be allowed, because the
lions are next to each other.

Write a recurrence relation that describes the number of ways that the two li-
ons can be placed into the n rooms. The recurrence relation should be a function
of n. Make sure to include base cases.

Part a: Write the recurrence relation for the case when the two lions are differ-
ent (e.g., <Lion 1><empty room><Lion 2> is different from <Lion 2><empty
room><Lion 1>).

Part b: Write the recurrence relation for the case when the two lions are in-
terchangeable (e.g., <Lion 1><empty room><Lion 2> is the same as <Lion
2><empty room><Lion 1>).

problem 10 Recurrence 2

Consider the following algorithm:

1: function SumElement(array A)
2: if length( A) == 1:
3: return A[0]
4: else:
5: A1 ← A[0 : length( A)/2]
6: A2 ← A[length( A)/2 : length( A)]
7: return SumElement(A1) + SumElement(A2)
8: end function

1. Write the running time of this function as a recurrence relation.

Problem Set-1-3
2. Describe the running time of this function using big-O notation.

problem 11 Recurrence 3

Suppose that we are putting animals in a barn. There are three types of animals:
horses, cows, and goats. The barn has a fixed number of stalls (partitions). These
stalls are arranged in a single row, and are consecutive. Horses and cows are big,
and each need 2 stalls. A goat is small, and only needs 1 stall. Stalls are not al-
lowed to be empty. Assume that all horses are equivalent, all cows are equivalent,
and all goats are equivalent.

For example, in a barn with only 1 stall, you can only place 1 goat (G). In a
barn with 2 stalls, you could have one horse (H), or one cow (C), or two goats
(GG). In a barn with 3 stalls, there are 5 possible sequences: GGG, GH, GC, HG,
CG.

Find a recurrence relation that describes how many ways are there to arrange
the animals into a barn with n stalls. Hint: think about the last animal in the row
of stalls.

problem 12 Recurrence 4

Prove that if f ( x ) = o ( g( x )), then we must have that f ( x ) = O( g( x )). For this
problem, you must write a precise, formal proof.
The definition of small o, for every e > 0, there exists an xe such that f ( x ) ≤ eg( x )
for all x > xe .
problem 13 Recurrence 5
For each statement below, if the statement is true, then prove that it is true. If it is
false, give a counterexample showing where it fails.
1. If f ( x ) = O( g( x )) and g( x ) = O(h( x )), then f ( x ) = O(h( x )).
2. If g( x ) = O( f ( x )) and h( x ) = O( g( x )), then f ( x ) = O(h( x )).
3. For any two functions f and g, either f ( x ) = O( g( x )) or g( x ) = O( f ( x )).

problem 14 Recurrence 5

Use the induction method to prove a tight asymptotic lower bound (Ω-notation)
on the solution to the recurrence:
T (n) = 4 × T (n/2) + n2
Hint: You can use the master theorem to determine the run-time of T (n) first
(θ − bound), and use induction to proof the lower bound over that.

Problem Set-1-4
problem 15 Gold mosaic (10 points)

Suppose Tom Cruise (i.e., he is from Syracuse) has commissioned a mosaic


using 1kg bars of solid gold, specifically the type CreditSuisse mints in the di-
mension 80mm × 40mm.
Design an algorithm that takes as input a black and white grid of squares,
where each square representing a 40mm × 40mm region, and determines if the
black squares in the design can be entirely covered with gold bars. Note that gold
bars can never be split in half (that would destroy their value)! Each gold bar
covers exactly two of the squares. For example, consider the gold bars below, and
the pixel art mosaic of Bob (taken from minecraftpixelarttemplates.com). Can all
of Bobs face be covered in gold?

problem 16 Classrooms

Before the start of the Spring semester, the Registrar must assign each class to
a time and a classroom. The classroom must be larger than the class it holds
to properly seat all the students. Suppose there are n classes such that class i
has si students enrolled. The university has m rooms, and room j can hold r j
students. Finally, there are non-overlapping time slots t1 , . . . , tk for the classes.
For example t1 is ‘CIS 675’ and t2 is ‘CST 700’ and so on. Given all this data,
namely, given (s1 , . . . , sn ), (r1 , . . . , rm ), (t1 , . . . , tk ), design an efficient algorithm
that assigns classes to times and classrooms. Analyze the running time and argue
correctness.

problem 17 Greedy 1

In the Grand Tour problem, you are given a list of n cities along with their pair-
wise distances (i.e., you know the distance between every two cities). All distances

Problem Set-1-5
are positive and symmetric (the distance between A and B is equal to the distance
between B and A). You begin at a specified city C0 , and must perform a ‘tour’, in
which you visit every other city exactly once, and then return to C0 . The goal is
to minimize the total distance traveled.

Design a reasonable greedy algorithm for solving this problem. Does it always
find the correct answer (i.e., the shortest tour)? If yes, prove that it is always cor-
rect, and if no, provide a counterexample.

problem 18 Greedy 2

In class, we discussed the concept of a matching in bipartite graphs. We can de-


fine a similar concept for non-bipartite graphs. A perfect matching in a graph G is a
set of edges S such that every node from G is adjacent to (i.e., appears in) exactly
one edge from S (no more and no less). The graph might represent students in a
classroom: each student is willing to work with some other students on a partner
project, and we want to figure out how to pair them so that everyone has one
partner. For example, in the graph below, the bolded edges represent a perfect
matching.

Suppose you are given a binary tree T with vertices V and edges E. This tree is
not necessarily a complete binary tree: i.e., every node has at most 2 children, but
might only have 0 or 1 child. Describe an efficient greedy algorithm to determine
if T has a perfect matching. Your algorithm does not have to work for non-tree
graphs.

Note: in many graph algorithms in class, we did not worry about how the graph
was represented in memory. We could say things like ‘for all edges in E’, without
being explicit about the data structure used to represent E. You may do the same
here.

problem 19 Greedy 3

You run the pool on Saturdays. There must always be a lifeguard on duty. There
are n lifeguards who can work, but they are busy college students with complex

Problem Set-1-6
social obligations; lifeguard i can work starting at time ai and ending at time bi on
Saturdays. Your goal is to cover the entire day from 8a–8p using the fewest lifeguards
as possible.
The first idea that comes to mind is to start with an empty schedule, and then
add the guard who covers the most amount of time that is not already covered. Show
that this algorithm fails by providing a counter-example.
Devise and analyze a greedy algorithm that solves the problem in linear time.

problem 20 DP 1

Prove that edit distance of reverse strings is same as original edit distance.

problem 21 DP 2

Maximum alternating subsequence sum. You are given a sequence of n num-


bers x1 , ..., xn . Your goal is to find the maximum alternating sum of a contiguous
subsequence within this sequence. An alternating sum of a sequence x j , ..., xk is
defined as x j − x j+1 + x j+2 − x j+3 + xj + 4 − ... ± xk . j and k reflect indices within
the original sequence. Note that you do not have flexibility in determining which
terms are added and which are subtracted: the first, third, etc. terms are always
added, and the others are subtracted. Your algorithm does not have to output the
best subsequence: just its sum.

problem 22 DP 3

You have a set of coins. Each coin i has value vi . Your goal is to find a set of
coins with total value exactly equal to V. You can use only one copy of each
coin. Design a dynamic programming algorithm to solve this. (Hint: Think about
knapsack problem)
Possible variation: Do the same as Problem, but now you can use multiple copies
of each coin.
Hint: https://www.geeksforgeeks.org/coin-change-dp-7/

problem 23 DP 4

You are given a series of boxes. Each box i has a rectangular base with width Wi
and length Li , as well as a height Hi . You are stacking the boxes, subject to the
following: In order to stack a box i on top of a second box j, the width of box i
must be strictly less than the width of box j and the length of box i must be strictly
less than the length of box j (assume that you cannot rotate the boxes to turn the
width into the length). Your job is to make a stack of boxes with total height as
large as possible. You can only use one copy of each box.

Describe an efficient algorithm to determine the height of the tallest possible


stack. You do not need to write pseudocode (though you can if you want to), but

Problem Set-1-7
in order to get full credit, you must include all the details that someone would
need to implement the algorithm.

problem 24 DP 5

A palindrome is a sequence of characters that is the same if it is reversed. For


example, ‘anna’ is a palindrome. Suppose that you are given a sequence of char-
acters, and wish to determine whether it is made of one of more palindromes
placed next to each other. For example, ‘dadseesanna’ is made of the palindromes
‘dad’, ‘sees’, and ‘anna’, placed next to each other. Design a dynamic program-
ming algorithm to solve this problem.
Hint: https://www.geeksforgeeks.org/longest-palindromic-subsequence-dp-12/
There are many problems that can be solved with similar DP structure.

problem 25 DP 6

You are riding a series of trains along a number line, and are trying to reach from
point 0 to point N. There are k trains that travel along pieces of this number line,
and each train Ti travels from starting point si to finish point f i . It is possible for
two trains to have the same starting point, but different finish points (or the same
finish point, but different starting points).
Design a dynamic programming algorithm to determine the sequence of trains
you should take so that you can get from point 0 to point N with as few train trans-
fers as possible. Analyze the running time of your algorithm.
Part a: Explain how to construct a directed acyclic graph (DAG) corresponding to
this problem.
Part b: Describe a dynamic programming algorithm for solving the problem. You
can explain your solution in terms of a common dynamic programming problem
on the DAG from Part a, but can use other solutions if you prefer.

problem 26 DP 7

You manage a hedge fund. Suppose you are given an array of numbers a1 , . . . , an
that summarizes a trader’s earnings (or losses) for n days. Devise a θ (n) time
algorithm that computes the most lucrative trading period for this trader; i.e.,
your algorithm must find the pair (i, j) where i ≤ j that maximizes the sum
j
s = ∑k=i ak . Output (i, j, s). Prove your algorithm correct and analyze its running
time. (Assume additions are O(1)-time operations.)

problem 27 DP 8

Suppose you are given an array A of integers, and want to find the longest odd-
even subsequence in A. An odd-even subsequence is a subsequence that alternates
between odd and even numbers (the first value can be either odd or even). Design
a dynamic programming algorithm to solve this problem. Your algorithm should

Problem Set-1-8
return the length of the longest odd-even subsequence, but doesn’t have to return
the subsequence itself.

problem 28 DP 9

You are given an n × m chompo bar. Your goal is to devise an algorithm A that
takes as input (n, m) and returns the minimal number of cuts needed to divide
the bar into perfect squares of either 1x1, 2x2, 3x3, . . ., jxj. With each cut, you can
split the bar either horizontally or vertically. For example, A(2, 3) = 2 because 2x3
→ (2x2, 1x2) → (2x2, 1x1, 1x1).

1. Notice that no matter the rectangle, it is always possible to make a perfect


square in the first cut. Show that this strategy fails. Namely, show an input
size for which the strategy of picking the cut which creates the largest box
leads to extra cuts in total.

2. Devise a DP algorithm which determines the minimal number of cuts.

problem 29 Unbounded Knapsack (Repetition of items allowed)

Given N items each (item i) with an associated weight wi and value vi (benefit
or profit). The objective is to fill the knapsack with items such that we have a
maximum profit without crossing the weight limit W of the knapsack. In the
Unbounded version of the problem, we are allowed to select one item multiple
times, unlike the classical one, where one item is allowed to be selected only once.

problem 30 Graph 1

Suppose that you are given an undirected graph, and want to find the shortest
cycle in the graph (i.e., the cycle with the fewest edges). I propose the following
algorithm: run DFS on the graph, and create the DFS tree. Suppose u is an
ancestor of v in the tree, and I see a back edge (v, u). This means that there is a
cycle containing the edges from u to v in the DFS tree and the back edge (v, u).
So as I am constructing this tree, keep track of these observed cycles, and at the
end, output the shortest such cycle. Give an example showing a case where this
strategy could fail.

problem 31 Graph 2

You are laying optical fiber cables to bring internet to a new area of the country.
The cables can only be placed between certain pairs of cities. In other words, the
cities and possible cable locations can be described as an undirected graph, where
each node represents a city and the edges represent the possible locations for plac-
ing cable. Each edge e is associated with a distance de that tells you the distance
between the corresponding cities in miles.
You want to connect City S to City T through a series of cables (where S and T are

Problem Set-1-9
specified by the user); however, each cable that you have is exactly L miles long,
and you cannot connect two cables in between cities. So if there is an edge from
City S to City A that is L − 1 miles long, and an edge from City A to City T that is
L − 2 miles long, then you could lay cable from S to A to T. However, if the edge
from S to A was L + 1 miles long, you would have to find a different route.
a: Create an algorithm to determine whether you can connect City S to City T,
given the structure of the graph and your limited-length cables. Your algorithm
should run in time O(| E|), where | E| is the number of edges. Show that your
algorithm meets this running time.
b: A vendor is offering to sell you longer cables. Create an algorithm to determine
the minimum length required that will allow you to connect City S to City T. Your
algorithm should run in time O(|V | + | E|) log |V |) time, where |V | is the number
of vertices. Show that your algorithm meets this running time.

problem 32 Graph 3

a. Prove that in any connected, undirected graph, it is possible to remove some


vertex and still leave the graph connected.
b. Give an example of a strongly connected directed graph such that removal
of any vertex results in a graph that is not strongly connected.

problem 33 Graph 4

Suppose you are given an undirected graph G. Your goal is to determine whether
G contains a simple cycle of length 4 (a simple cycle is a cycle that does not cross
itself- i.e., the cycle can be written as a length-4 sequence of nodes a, b, c, d, where
a, b, c, and d are all different). Design and analyze an algorithm to do this, that
takes at most |V |3 , where |V | is the number of vertices.

Solution Hint: Use BFS, paying special attention to the nodes that are distance 2
from the source. If a simple cycle exists, what will you observe while running the
BFS? How long does BFS take? How many times would you have to run it?

Solution Hint 2: Iterate over every pair of vertices u, v (not necessarily neighbors).
How can you use the neighbors of u and v to tell if u and v participate in a cycle
of the form (u, a, v, b)?

problem 34 Graph 5

Suppose that you are given an undirected graph G in which every edge has a
weight of 1. You are given a source node s, and want to find the shortest distance
to every other node in the graph.

Problem Set-1-10
Prove that Dijkstra’s Algorithm is equivalent to BFS in this case. Hint: An easy
way to prove this is to show that at each point in the process, BFS makes the same
choice as Dijkstra’s.

problem 35 Graph 6

Suppose that you have a weighted, undirected graph, and are trying to find the
length of the shortest path from a node s to some other node t. You decide to
use Dijkstra’s algorithm for this. However, your graph is gigantic, and running
Dijkstra’s on the whole thing will take a very long time. So instead, you perform
two simultaneous searches in parallel. In one search, you begin at node s, and
gradually discover shortest paths from s to other nodes. In the other search, you
begin at node t, and gradually discover shortest paths from t to other nodes (and
because the graph is undirected, this process also tells you the shortest paths from
those nodes to t). In each iteration, suppose the first search has discovered short-
est paths from s to some set of nodes Rs , and the second search has discovered
paths from t to some set of nodes Rt .

Initially, Rs only contains s and Rt only contains t. This process continues until Rs
and Rt have some overlap; that is, you find some node u that is present in both Rs
and Rt . Then if the distance from s to u is d1 and the distance from u to t is d2 ,
you report that the distance between s and t is d1 + d2 .

Will this procedure give you the correct shortest path from s to t? If yes, prove
that it will work. If no, give an example showing where it can fail.

problem 36 Graph 7

Create an algorithm to determine whether a connected graph is a bipartite graph.


Hint: start with a random node, and give it label 1. Which group must its neigh-
bors be in? And their neighbors?
Hint: You can always do brute force. But, we want a better solution.

problem 37 Graph 8

We are given a directed graph G with positive weights on its edges. We wish to
find a shortest path from s to t, and, among all shortest paths, we want the one in
which the longest edge is as short as possible. How would you modify Dijkstras
algorithm to this end?

problem 38 Graph 9

Suppose we are given a large matrix A[1 . . . m][1 . . . n] of population data (each
entry is a non-negative real number). We want to publish matrix A, but need to
simplify it for the public by making the entries integers by replacing each entry x

Problem Set-1-11
in A with either d x e or b x c. However, the matrix represents important population
data, and we do not want to change the sums of entries in any row or column.
For example:
   
1.2 3.4 2.4 1 4 2
 3.9 4.0 2.1  →  4 4 2 
7.9 1.6 0.5 8 1 1
Using max flow, describe and analyze an efficient algorithm that either rounds
A in this fashion, or reports correctly that no such rounding is possible.

problem 39 Graph 10

The Dinosaur Bar-B-Que food truck produces a large variety of different lunch
menu items. Unfortunately, they can only produce their foods in limited quanti-
ties, so they often run out of popular items, making customers sad.
To minimize sadness, Dinosaur Bar-B-Que is implementing a sophisticated
lunch-ordering system. Customers text in their acceptable choices before lunch
time. Then they can use an algorithm to pre-assign lunches to customers. Cus-
tomers who do not get one of their choices should receive a $5 voucher. Dinosaur
Bar-B-Que would like to minimize the number of vouchers they give out. Design
an efficient algorithm for Dinosaur Bar-B-Que to assign lunches to customers. In
general, suppose that, on a given day, Dinosaur Bar-B-Que has produced m types
of food items b1 , ..., bm , and the quantity of each type of food item b j is exactly q j .
Suppose that n customers a1 , ..., an text in their preferences, where each customer
ai submits a set Ai of one or more acceptable lunch choices. The algorithm should
assign each customer either one of his/her choices or a $5 voucher. It should
minimize the number of vouchers. (Hint: Model this as a max flow problem.)

problem 40 Greedy 4

You are running an art museum. There is a long hallway with k paintings on the
wall. The locations of the paintings are l1 , ..., lk . These locations are real numbers,
but not necessarily integers. You can place guards at locations in the hallway, and
a guard can protect all paintings within 1 unit of distance from his location. The
guards can be placed at any location, not just a location where there is a painting.
Design a greedy algorithm to determine the minimum number of guards needed
to protect all paintings.
Hint: Suppose the locations are in sorted order (if they are not, then sort them)
from left to right. The first painting (furthest to the left) must be protected by a
guard. If you place that first guard as far to the right as possible, while still cover-
ing the leftmost painting, then that will maximize the number of other paintings
protected. So where should the first guard be placed? After placing the guard,
some other paintings may be protected (or maybe there are no other paintings
within reach of that guard). Restart the process with the next unprotected paint-
ing.

Problem Set-1-12
problem 41 Greedy 5

Suppose you are given a set of jobs J1 , ..., Jm to perform. Each job Ji will pay you
some amount of money pi (not all jobs give the same payment). Each job Ji addi-
tionally has a deadline di , and if the job is not complete before its deadline, you
will not receive any of the payment for that particular job. Assume that the time-
line starts at time 0. Each job takes one unit of time to perform.
For example, suppose that there are three jobs J1 , J2 , J3 , with payments of 1, 2, 5
and deadlines of 3, 1, 1. Then the best schedule is to do job J3 from time 0 to time
1, and job J1 from time 1 to time 2 (or time 2 to time 3). Because the timeline starts
at time 0 and each job takes 1 unit of time to complete, it is not possible to do both
jobs J2 and J3 before their deadline at time 1. Then after time 1, J1 is the only job
left, so we select it, and get a total payment of 6.

Design a greedy algorithm to determine the schedule of jobs that will maximize
the amount of payment that you receive. Your algorithm should output the actual
schedule, not just the total payment (i.e., for each job, it should tell me when that
job will start, or if it won’t be scheduled at all, then it should say that).

problem 42 Greedy 6

Suppose you are given a weighted, undirected graph G with vertex set V, and a
subset U of V (i.e., U is a set of some vertices from G). We want to find the lightest
weight spanning tree of G such that all vertices in U are leaves in this spanning
tree. Note that this definition is not equivalent to the definition of a minimum
spanning tree. Design a greedy algorithm to find such a tree. (Note: If you want
to refer to any algorithm we covered in class, you may do that without restating
the algorithm.)

problem 43 Additional Leetcode Problems

Write Pseudo code, give correctness argument for your code. All Leetcode solu-
tions are available in internet, hence there is no point for giving Pseudo-code/code
only. This particular leetcode problem set is included to encourage you solving
leetcode. CIS 675 course assignments and Final exam would not have these kind
of problems.

• Problem 518: https://leetcode.com/problems/coin-change-2/

• Problem 938: https://leetcode.com/problems/range-sum-of-bst/

• Problem 3: https://leetcode.com/problems/range-sum-of-bst/

• Problem 76: https://leetcode.com/problems/minimum-window-substring/

• Problem 279: https://leetcode.com/problems/perfect-squares/

Problem Set-1-13

You might also like