Get the Maximum Length of a Concatenated String with Unique Characters in Python
The problem
Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters.
Return the maximum …
Read Article →329 articles about python development, tools, and best practices
Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters.
Return the maximum …
Read Article →Let’s say that you have a Python list with the following 5 foods:
foods = ["pizza", "pasta", "steak", "chicken", …
Read Article →
This is not the first time that I created a Python3 application that spat out some output and required access to it via an HTTP server.
While there …
Read Article →Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
Note that elements beyond …
Read Article →Python has never been the best at doing multiple things at the same time.
While there are ways to mostly resolve this, such as using the …
Read Article →Let’s say that you have an array or a list, or logs.
Each of these logs is a space-delimited string of words.
For example:
logs = ["dig1 8 …
A common programming interview question, and for a change, one that you will actually be able to use in the job, is that of implementing a Queue by …
Read Article →Take a string S of lowercase letters.
These letters form consecutive groupings of like characters.
Find groups with 3 or more like …
Read Article →Google Colab is a fantastic environment to write Python code using Jupyter Notebooks, hosted for free by Google.
If you’ve ever used Jupyter …
Read Article →A User-Agent is a bunch of text that is sent with every HTTP and HTTPS request. The server processing this request is able to determine what type of …
Use the Linux/Mac tail command to provide the data:
line = subprocess.check_output(['tail', …
Read Article →
As Python developers, we’ve all used pip to install applications, but speaking to other Python developers, it’s not always clear how to …
Sending emails using Python and AWS’ SES service is really easy. They provide an SMTP server that you can authenticate against and send email …
Read Article →Sometimes you may need to read the top n lines of a file using Python.
We start by opening the file for reading and then using a list comprehension we …
Read Article →I operate a bunch of different sites and have done for many years now.
Some of them get quite a lot of traffic and require a high level of uptime.
To …
Read Article →Learning Go or Golang as a Python developer, programmer or software engineer is easier than you think.
While there are quite a lot of things to learn …
Read Article →Let’s say that you have two dates:
"2019-01-29"
"2019-06-30"
How would you create a function that would return the number of …
Read Article →Given a directory that contains:
|
|- app.py
|- requirements.txt
|- ...
|- <- other-files ->
|- ...
We can create a runme.sh file to always make …
Given that we are in a leap year this year (2020), it would be nice to know how to programmatically calculate this.
Luckily, this is a repeatable …
Read Article →It’s important to know about data types and one that comes up fairly regularly is that of Linked Lists.
Let’s write the following base …
Read Article →In this tutorial, we will create a Python application that can be installed directly from pip that will show the 10 latest blog posts from this …
This occasionally comes up during coding interviews and is actually quite a decent way to test someone’s aptitude of moving back and forth on a …
Read Article →Let’s say that you have a binary tree and we needed to know it’s maximum depth.
Binary tree input data [3,9,20,null,null,15,7] could be …
Fizz buzz is a common programming interview question.
The problem statement usually reads something like this:
Read Article →Write a short program that …