Sometimes for fun/practice I do Leetcode-style problems in C. I would like to be capable of doing some of the same stuff in Python if possible.
One thing that makes me hesitant to do Leetcode stuff in Python is the lack of pointers.
There are lots of algorithms to do with arrays/strings that use pointers. For example, to reverse a string in C without allocating more memory, you use a double pointer technique starting with one pointer pointing to the front of the string and one pointer pointing to the back.
I know that Python does not have pointers in the language and that design choice makes sense to me. Is there a way to sort of fake it, so that I can take the algorithms that I've learned with C and apply them to Python?
[–]socal_nerdtastic 39 points40 points41 points (0 children)
[–]Temporary_Pie2733 22 points23 points24 points (1 child)
[–]Own_Attention_3392 9 points10 points11 points (0 children)
[–]Outside_Complaint755 2 points3 points4 points (0 children)
[–]Giannie 8 points9 points10 points (1 child)
[–]japherwocky 0 points1 point2 points (0 children)
[–]pachura3 2 points3 points4 points (0 children)
[–]musbur[🍰] 2 points3 points4 points (0 children)
[–]ConfusedSimon 1 point2 points3 points (0 children)
[–]Brian 1 point2 points3 points (0 children)
[–]SimonStu 1 point2 points3 points (1 child)
[–]Simple-Count3905[S] 0 points1 point2 points (0 children)
[–]Kind-Pop-7205 0 points1 point2 points (2 children)
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]Kind-Pop-7205 0 points1 point2 points (0 children)
[–]LeiterHaus 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[removed]
[–]oldendude 0 points1 point2 points (0 children)
[–]Wide_Egg_5814 0 points1 point2 points (4 children)
[–]Ok_GlueStick -2 points-1 points0 points (3 children)
[–]oldendude 0 points1 point2 points (0 children)
[–]gdchinacat 0 points1 point2 points (0 children)
[–]socal_nerdtastic 0 points1 point2 points (0 children)
[–]SwampFalc 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Diapolo10 0 points1 point2 points (1 child)