Back to Browse

LeetCode Valid Anagram in Python | My Fast Beginner Solution

3 views
May 12, 2026
6:55

Today I solved the “Valid Anagram” problem on LeetCode using Python. At first, I completely misunderstood what an anagram was. I initially thought it was something symmetrical like a palindrome. Then I realized an anagram simply means: two different words using the exact same letters in a different order. My approach was: * sort both strings alphabetically using `sorted()` * compare the two sorted results * return True if they match The exercise itself was easier than expected, but I still had some doubts during the coding process: * should I use `sorted(string)` or `string.sort()`? * can two arrays/lists be compared directly in Python? * is using built-in sorting considered “too easy”? In the end, the solution worked perfectly and I solved it in about 7 minutes instead of the 25-minute target. In this video: * real-time coding session * beginner Python reasoning * algorithmic thinking under a timer * honest feedback after solving the problem Platform: LeetCode Language: Python 3 Problem: Valid Anagram #python #leetcode #coding #algorithms #programming #beginners #python3 #computerscience #anagram

Download

0 formats

No download links available.

LeetCode Valid Anagram in Python | My Fast Beginner Solution | NatokHD