Tagged Questions
11
votes
7answers
2k views
Is my solution to return kth row of the Pascal's triangle suitable for a job interview?
Question:
Given an index \$k\$, return the \$k\$th row of the Pascal's triangle.
For example, given \$k = 3\$, return \$[1,3,3,1]\$. Bonus points for using \$O(k)\$ space.
Can it be ...
2
votes
2answers
1k views
Fish Food Chain O(N)
I understand that if you don't know the trick, it's not easy create a solution with a complexity of O(N). However, I would like to ask you how to solve this tricky question:
You are given two ...
4
votes
2answers
674 views
Determining possible triangle from lengths of line segments [closed]
This Codility challenge is to take an array of integers representing lengths of line segments, and determine whether or not it is possible to choose three distinct segments to form a triangle. (The ...
-3
votes
1answer
1k views
Project Euler Problem 13 [closed]
Hi.
I'm a novice C programmer. I'm trying to solve problem 13 but I feel as if my solution isn't as elegant as it could be. Can you please help me by providing me with advice on how to solve this ...