Farjanul Nayem126
how can I sell python code?
There are several ways to sell your Python code, depending on what kind of code it is and what your goals are. Here are a few options: Sell your code as a product: If you have written a piece of code...
Regular expression to search digit inside a string in python
We will use the ( \d ) metacharacter, we will discuss regex metacharacters in detail in the later section of this article. Let's take a simple example of a regular expression to check if a string contains...
How to make python class JSON serializable?
The built-in json module of Python can only handle Python primitives types that have a direct JSON equivalent. i.e., The fundamental problem is that the JSON encoder json.dump() and json.dumps() only...
How to Give All Permissions in Ubuntu?
You can also use the command to give permissions to the selected folder and its files. Method 1: [apcode language="bash"] sudo chmod -R a+rwx /path/to/folder // For the hole directory sudo chmod -R...
How To Set or Change Linux User Password?
Linux Set User Password Open the Linux terminal application. Type following passwd command command to change your own password: [apcode language="bash"] passwd [/apcode] Sample output: [apcode...
What does a typical the microservice architecture look like?
The diagram below shows a typical microservice architecture. Load Balancer: This distributes incoming traffic across multiple backend services. CDN (Content Delivery Network): CDN is a group of geographically...
Implement strstr() – return the index of the first occurrence of needle in haystack or -1
O(nm) runtime, O(1) space – Brute force: Difficulty: Easy, Frequency: High Returns the index of the first occurrence of needle in haystack, or –1 if needle is not part of haystack....
Valid Palindrome: converting uppercase to lowercase and removing non-alphanumeric characters
O(n) runtime, O(1) space: The idea is simple, have two pointers – one at the head while the other one at the tail. Move them towards each other until they meet while skipping non-alphanumeric characters....
Two Sum: Data structure design
add – O(n) runtime, find – O(1) runtime, O(n2) space – Store pair sums in hash table: We could store all possible pair sums into a hash table. The extra space needed is in the order of O(n2). You...
Two Sum: Input array is sorted
Of course we could still apply the [Hash table] approach, but it costs us O(n) extra space, plus it does not make use of the fact that the input is already sorted. O(n log n) runtime, O(1) space – Binary...