All Questions
4 questions
4
votes
1
answer
3k
views
Find number of horizontal brush strokes to paint a skyline
Asked in interview today:
You want to paint a skyline on your wall using only horizontal brush strokes. You are given an array of numbers, each representing the size of the column/building in that ...
2
votes
1
answer
2k
views
Rotate matrix 90 degrees
I recently did problem 1.7 Rotate Matrix in Cracking the Coding Interview. I realized my code is very different than what is in the book and also from what I'm finding online (I'm having trouble ...
6
votes
2
answers
6k
views
Find maximum gap between elements of an array
I am solving interview questions from here.
Problem : Given an array A of integers, find the maximum of j - i subjected to the constraint of A[i] <= A[j].
Example : A = [3 5 4 2] Output : 2 for ...
9
votes
5
answers
31k
views
Python code to check if an array has a sequence (1,3,4)
I recently applied for a job as a Python coder but was rejected.
This was the problem:
Write a python code to check if an array has a sequence (1,3,4)
Assuming they were looking for expert Python ...