Software Engineer
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
a simple python solution
cur=[]
count=0
Arr=[...some stuff...]
def ss2(n,k):
global count
count+=1
if k==0:
print cur # maybe cur is the index of Arr
return
for i in range(k-1,n):
cur.append(i)
ss2(i,k-1)
cur.pop()
ss2(10,3)
print count # for time complexity
Comment hidden because of low score. Click to expand.
0
of 0 vote
an O(sizeof(long string) + sizeof(small string) * length-of-each-small-string )) solution lives here:
computationalpuzzles.wordpress.com/2011/11/17/substring-with-concatenation-of-all-words-in-a-list/
but im highly suspicious if this is really a phone interview prob. The algorithm may be too hard to write in 45 minutes.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
a simple python solution
- Software Engineer March 25, 2012