Determine if Two Strings Are Close - Python

  Рет қаралды 876

DEEPTI TALESRA

DEEPTI TALESRA

Күн бұрын

Пікірлер: 8
@dinglegary
@dinglegary 25 күн бұрын
Awesome vid but minor note - for those of us not using python (js pleb, ik), it would be super helpful if things like creating a counting dict weren't abstracted away via an import. Just a thought, but either way, grateful for the vid :)
@Arjun-d1u
@Arjun-d1u 3 ай бұрын
The best moment in every video "...And, it is accepted". 😂😂 That satisfaction after seeing Success.
@deepakjyoti8355
@deepakjyoti8355 3 ай бұрын
Dashing videos by dashing Deepti !
@joneskiller8
@joneskiller8 2 ай бұрын
Why check for the values when you are checking for the length already? The characters can be transformed to other existing characters within the string so it should not matter.
@shravan1791
@shravan1791 3 ай бұрын
Small correction: ```return (sorted(counts1.keys()) == sorted(counts2.keys())) and (sorted(counts1.values()) == sorted(counts2.values()))```
@jango8
@jango8 2 ай бұрын
made it without collections, and dicts, and more readable as well , beats 99.99 % class Solution: def closeStrings(self, word1: str, word2: str) -> bool: word1_vals, word2_vals = set(word1), set(word2) if ( len(word1) != len(word2) or word1_vals != word2_vals ): return False else: word1_frequencies: List[int] = sorted( [word1.count(letter) for letter in word1_vals] ) word2_frequencies: List[int] = sorted( [word2.count(letter) for letter in word2_vals] ) return word1_frequencies == word2_frequencies
@glasskey_
@glasskey_ 3 ай бұрын
Thank you for posting a Medium finally
@theja63
@theja63 Ай бұрын
👁👄👁
Daily Temperatures - LeetCode 739 - Python #leetcode #stack
11:03
70% of Programmers can't solve this LeetCode Easy Question
7:32
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Leetcode - Determine if Two Strings Are Close (Python)
5:33
Timothy H Chang
Рет қаралды 6 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 702 М.
BRAIN ROT | Why You Are Losing Control Of Your Brain?
17:40
Aevy TV
Рет қаралды 589 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 596 М.
are we cooked w/ o3?
13:58
ThePrimeTime
Рет қаралды 316 М.
Thoughts About Unit Testing | Prime Reacts
11:21
ThePrimeTime
Рет қаралды 240 М.