LONGEST COMMON PREFIX | LEETCODE # 14 | PYTHON SOLUTION
ฝัง
- เผยแพร่เมื่อ 19 ก.ย. 2024
- LINK: leetcode.com/p...
Simple string based problem that is used as a common warm-up problem. Relatively straightforward logic, just need to vertically compare the characters until we get a mismatch or a given string ends.
Correct my logic please, if I am wrong. For each character iterating through strs over and over again, wouldn't that be O(S^2)? Given the constrains 1
Are you preparing for interviews?
No just making videos of popular questions and trying to force myself to make at least 1 video a day to grow the channel