Leetcode Coding Interview Problems live!

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

52:33 -- The supposedly 'better answer'.
1:23:07 -- LC 1675 - 'Minimize deviation in array' solution
1:39:14 Alternative soln. Faster one, for parenthesis problem
1:50:28 An improvisation on bracket problem, suggested by chat

vishnusingh
Автор

For problem 1312 I have a O(n*n*n) approach and it's quite interesting (atleast for me)
1) A string S is palindrome if it is mirror image around a pivot.
2) Suppose we know the pivot. What now?
3) Calculate longest common subsequence for string reverse(S[0]..[pivot-1]) and S[pivot+1][S.length-1]
4) minimum insertion = S.length - 2*LCS
5) Brute force over all pivots and find the minimum

Note : Point 3 has to be repeated for two more possibilities:
a) reverse(S[0]..[pivot]) and S[pivot+1][S.length-1]
b) reverse(S[0]..[pivot-1]) and S[pivot][S.length-1]

piyushpatel
Автор

2:01:10 You can hit CTRL and click at multiple places to start typing simultaneously.

lakshyaj
Автор

Lo reader, hope u are having a nice day! Amazing videos usual errichto! Your dedication and work ethic is truly inspiring. Keep it up! Thanks a lot!

yashvardhansharma