Goldman Sachs Interview | Goldman Sachs Interview questions | faad coder | Strings |String Algorithm

preview_player
Показать описание
Note:- Search for @faadcoder in Telegram App.
-------------------------------------- #GoldmanSachsInterview
#GoldmanSachsInterviewquestions
#faadcoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please Like,Share and Subscribe the channel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stay connected for more new updates.
Рекомендации по теме
Комментарии
Автор

But the time complexity is O(2^n*n) but it can be solved in O(2^n)
Btw nice video!!!

rishisharma
Автор

Bro please make a full series on c++ with full STL

sauravjaiswal
Автор

I need to do backtracking and reset the string index to ? to generate all possibilities whereas your code doesn't need to. Can u tell why. Here is my code:
def solve(s, index):
if index>=len(s) or "?" not in s:
print("".join(s))
return
if s[index]=="?":
s[index]="1"
solve(s, index+1)
s[index]="0"
solve(s, index+1)
s[index]="?"
else:
solve(s, index+1)

s="1??0?"
s=list(s)
solve(s, 0)

bismeetsingh
Автор

Can we just not run directly from pos = 0 and put base condition as pos == s.size()

physicslove