This repository contains code listings for ALX interview questions. The code listings are grouped into directories based on the topics they cover.
The topics are listed in order below: Click on any of them to view the code listings for that topic.
-
- Contains code listings for the Pascals Triangle problem.
-
-
You have
n
number of locked boxes in front of you. Each box is numbered sequentially from0
ton - 1
and each box may contain keys to the other boxes. -
Write a method
canUnlockAll(boxes)
that determines if all theboxes
can be opened.
-
-
-
In a text file, there is a single character
H
. Your text editor can executeonly two operations
in this file:Copy All
andPaste
. Given a numbern
, write a method that calculates thefewest number of operations
needed to result in exactlyn H
characters in the file. -
Prototype:
def minOperations(n)
-
Returns an
integer
-
If n is impossible to achieve, return
0
-