Open in app

Sign In

Write

Sign In

Jacob Bennett
Jacob Bennett

1.5K Followers

Home

About

Published in Planet Python

·3 days ago

Solution to LeetCode #1: Two Sum (Python)

Top 0.2% of solutions — This is an easy LeetCode problem (source). Jump to the solutions ↓ 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…

Python

5 min read

Solution to LeetCode #1: Two Sum (Python)
Solution to LeetCode #1: Two Sum (Python)
Python

5 min read


Published in Planet Python

·4 days ago

Yes, you can write switch statements in Python

And it comes with a secret superpower — With the release of Python 3.10, we got switch statements in the form of match 🎉 The basic syntax of the match statement is simple: match subject: case <pattern_1>: <action_1> case <pattern_2>: <action_2> case <pattern_3>: <action_3> case _: <action_wildcard> match supports basic and complex pattern matching, as well as a…

Python

5 min read

Yes, you can write switch statements in Python
Yes, you can write switch statements in Python
Python

5 min read


Published in Python in Plain English

·Mar 12

Should you use getters and setters in Python?

SOLID refactors, easy debugging, and practicality — Can you really refactor a module without breaking downstream dependencies? Is it possible to track down every last place a value gets updated? As your code evolves, you need to refactor logic written days, weeks, or years ago. Python makes it easy to refactor without breaking existing APIs. Keeping in…

Python

4 min read

Should you use getters and setters in Python?
Should you use getters and setters in Python?
Python

4 min read


Published in Planet Python

·Mar 12

Solution to LeetCode #232: Implement Queue using Stacks (Python)

Top 0.7% of submissions — This is an easy LeetCode problem Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Implement the MyQueue class: void push(int x) Pushes element x to the back of the…

Python

3 min read

Solution to LeetCode #232: Implement Queue using Stacks (Python)
Solution to LeetCode #232: Implement Queue using Stacks (Python)
Python

3 min read


Published in Level Up Coding

·Jan 10

Level up your code reviews

Run better code reviews as a senior engineer — Good code reviews are fast and thorough. Reviewing code is a core part of the job. And one of the hardest parts. We, engineers, put a lot of focus on our own productivity and effectiveness, while very little attention is usually paid to the queue of PRs that can pile…

Programming

7 min read

Level up your code reviews
Level up your code reviews
Programming

7 min read


Published in Level Up Coding

·Dec 12, 2022

Write Go like a senior engineer

What I wish I knew when I started writing Go — I started writing Go professionally in 2018. Here’s what I wish I could tell myself when I started. Go is pass-by-value Go is exclusively pass-by-value. That means each function receives a copy of the value of what you passed in. No exceptions. Sort of. You can pass pointers, too (you’re technically passing the…

Programming

7 min read

Write Go like a senior engineer
Write Go like a senior engineer
Programming

7 min read


Published in Level Up Coding

·Nov 16, 2022

A monorepo template that actually works

When you get it right, you’ll never go back. — I’ve worked on dozens of projects ranging in size from the common 1–2 dev side project to full-scale enterprise applications. Monorepo architecture is a popular approach that can be intimidating at first but is a surprisingly powerful tool. (As an aside, Medium uses a monorepo for all of its product…

Programming

2 min read

A monorepo template that actually works
A monorepo template that actually works
Programming

2 min read


Published in Level Up Coding

·Nov 15, 2022

Use Git like a senior engineer

Git is a powerful tool that feels great to use when you know how to use it. — I’ve used these features of Git for years across teams and projects. I’m still developing opinions around some workflows (like to squash or not) but the core tooling is powerful and flexible (and scriptable!). Going through Git logs Git logs are gross to go through out of the box. git log is basic Using git log gives you…

Programming

4 min read

Use Git like a senior engineer
Use Git like a senior engineer
Programming

4 min read


Oct 14, 2022

Solution to LeetCode #237: Delete Node in a Linked List (Go)

This is a medium LeetCode problem — There is a singly-linked list head and we want to delete a node node in it. You are given the node to be deleted node. You will not be given access to the first node of head. All the values of the linked list are unique, and it is guaranteed…

Programming

2 min read

Solution to LeetCode #237: Delete Node in a Linked List (Go)
Solution to LeetCode #237: Delete Node in a Linked List (Go)
Programming

2 min read


Oct 11, 2022

Solution to LeetCode #1328: Break a Palindrome (Go)

This is a medium LeetCode problem. — Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the resulting string is not a palindrome and that it is the lexicographically smallest one possible. Return the resulting string. If there is no way to replace a character to…

Programming

3 min read

Solution to LeetCode #1328: Break a Palindrome (Go)
Solution to LeetCode #1328: Break a Palindrome (Go)
Programming

3 min read

Jacob Bennett

Jacob Bennett

1.5K Followers

Engineering, design, curiosity • Dev @ Medium • https://jacob.bio

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech