I should like to see some of the problems that take you 2-5 hours to solve. Show your solution, and text about the way you tackle the problem.
Perhaps you need a mentor, someone that can give you some tips about your coding abilities and what you should do to improve.
If you need more than 10 minutes to sum the cubes of numbers from 1 to n in python, then I think you have a problem as a programmer.
Can you point to a leetcode problem that takes you 2-5 hours to solve?
Edited: Two weeks ago you submitted a similar post and in the comments you give this example:
>> To give a concrete example of some of the above, just this morning I tried to code the brute force solution following problem: Give two sorted arrays return the median. I spent over an hour trying to implement the brute force solution involving linearly going through each array and couldn’t code it in Python.
As a hobby programmer, my ten minutes approach:
def median(a,b):
...: ab = len(a)+len(b)
...: pos = ab/2
...: ia = 0
...: ib = 0
...: for ic in range(pos):
...: if a[ia] <= b[ib]:
...: x = a[ia]
...: ia = ia + 1
...: else:
...: x = b[ib]
...: ib = ib + 1
...: if ab % 2 == 1 :
...: return x
...: else:
...: return (x + max(a[ia],b[ib]))/2
...:
But it is not correct
Perhaps you need a mentor, someone that can give you some tips about your coding abilities and what you should do to improve.
If you need more than 10 minutes to sum the cubes of numbers from 1 to n in python, then I think you have a problem as a programmer.
Can you point to a leetcode problem that takes you 2-5 hours to solve?
Edited: Two weeks ago you submitted a similar post and in the comments you give this example:
>> To give a concrete example of some of the above, just this morning I tried to code the brute force solution following problem: Give two sorted arrays return the median. I spent over an hour trying to implement the brute force solution involving linearly going through each array and couldn’t code it in Python.
As a hobby programmer, my ten minutes approach: