+ 4

Please help me

Hey everyone, I've been learning python for over a year and the amount of things I've managed to learn aren't so many. I've learnt the basics and so many concepts but when I go to leetcode and I try to apply my knowledge, I just can't seem to figure it out, even for easy problems like Two Sum. Sometimes I even wonder if I'm the problem. Please assist me.

29th Oct 2025, 1:30 PM
Kuri
Kuri - avatar
4 odpowiedzi
+ 5
solving coding problems, math problems or using code to simulate real world activity often start with being able to identify the main elements, the intended outcome and creating their symbolic representation in your code. this is probably the hardest part. you are transforming one thing into another thing. that's why you shouldn't just memorize coding syntax, keywords and data structures. you should also know how they behave, their capabilities and limitations. the components and semantics of the programming language are your building blocks for problem solving. you use them to model the problem you're solving. that's why learning without understanding is never useful. open a solved leetcode problem. go back and forth between the problem and solution and try to understand which part of the problem got converted into which part of the code. what operations were used. why was it used. understand the process. learning this way will slowly give you the mindset of a programmer.
30th Oct 2025, 2:52 AM
Bob_Li
Bob_Li - avatar
+ 4
Kuri #The basics of most codes is defining what you want to do def add(a,b): # the function return a+b # simplistic algorithm a = int(input()) # no. 1 b = int(input()) # no. 2 print(add(a,b)) # call function Math wording and interpretation sometimes can be confusing .. Leetcode Task: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Input: nums = [2,7,11,15], target = 9 Output: [0,1] nums = [2,7,11,15] a= int(input()) # no. 1 b= int(input()) # no. 2 # if target is 9 a = 0 and b = 1 print(nums[a] + nums[b])
29th Oct 2025, 2:51 PM
BroFar
BroFar - avatar
+ 4
According to your information, if you spent a year learning a language and didn't answer my question about what you've learned during that time, it's likely that you didn't pay enough attention to areas like algorithms and data structures. Edited: I recommend finding and downloading the electronic version or purchasing the printed edition of this book. It is the second edition. The examples of algorithms are presented in Python version 3 "Aditya Y Bhargava Grokking Algorithms, Second Edition" DSA courses "Data Structures and Algorithms" (free and paid): 👇 https://www.geeksforgeeks.org/blogs/best-data-structures-and-algorithms-courses/?ysclid=mhasjl2st121367810 How to solve leetcode problems: https://www.designgurus.io/answers/detail/how-to-solve-leetcode-problems-as-a-beginner
31st Oct 2025, 1:33 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 3
Kuri here are two examples in this code... https://sololearn.com/compiler-playground/cjKwlEx6zJTR/?ref=app
29th Oct 2025, 3:51 PM
BroFar
BroFar - avatar