Pixability Interview Report
- 0of 0 votes
Answers2. CURIOUS ANT (easier)
- Sritharan Mahendra Babu February 22, 2015 in United States
Assume you have a typical tree-like structure. Each branch can have more children branches but it can also have some number of fruits (this is just a number associated with each branch).
Imagine an ant that wants to start at the root or the tree and go to the very end of some branch path. The ant is asking you: is it possible for me to encounter at least N fruits on my way?
Write a program that answers Yes or No to this question.
Write the code in Python| Report Duplicate | Flag | PURGE
Pixability Software Engineer Algorithm - -1of 1 vote
Answers1. DR. ROPES (harder)
- Sritharan Mahendra Babu February 22, 2015 in United States
Assume you have some number of ropes of varying length.
For example: 2 ft, 5 ft, 6 ft, 6 ft (possible to have two or more ropes of the same length).
Write a program that determines if it is possible to string together the ropes to produce length of exactly N.
For the example set above, your program would answer:
N of 7 : yes
N of 11 : yes
N of 3 : no
N of 12 : yes
N of 18 : no
Note: Please write your solution without using the itertools package.
Write the code in Python| Report Duplicate | Flag | PURGE
Pixability Software Engineer Algorithm