First thing first, lets install some tools we need.

  1. WebAssembly Binary Toolkit, or wabt

To make life easier, I have updated my zshrc file, so i can run wabt commands. Like

As you can see, I have downloaded wabt in Downloads folder and I unzip there.

Now run the command from a different terminal

If that works, you are ready to write your…


Given an integer (in base ) and a base , return the sum of the digits of after converting from base to base .

After converting, each digit should be interpreted as a base number, and the sum should be returned in base .

Example 1:

Example 2:

Constraints:


The frequency of an element is the number of times it occurs in an array.

You are given an integer array and an integer . In one operation, you can choose an index of and increment the element at that index by .

Return the maximum possible frequency of an element after performing at most operations.

Example 1:

Example 2:


You are given two positive integer arrays and , both of length .

The absolute sum difference of arrays and is defined as the sum of for each (0-indexed).

You can replace at most one element of with any other element in to minimize the absolute sum difference.

Return the minimum absolute sum difference after replacing at most one element in the array . Since the answer may be large, return it modulo .

is defined as:

  • if , or

You are given the logs for users’ actions on LeetCode, and an integer . The logs are represented by a 2D integer array where each indicates that the user with performed an action at the minute .

Multiple users can perform actions simultaneously, and a single user can perform multiple actions in the same minute.

The user active minutes (UAM) for a given user is defined as the number of unique minutes in which the user performed an action on LeetCode. …


A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase and lowercase English letters (no punctuation).

  • For example, , , and are all sentences.

You are given a sentence ​​​​​​ and an integer ​​​​​​. You want to truncate ​​​​​​ such that it contains only the first ​​​​​​ words. Return ​​​​​​ after truncating it.

Example 1:


You are given an even integer ​​​​​​. You initially have a permutation of size ​​ where (0-indexed)​​​​.

In one operation, you will create a new array , and for each :

  • If , then .
  • If , then .

You will then assign ​​​​ to .

Return the minimum non-zero number of operations you need to perform on to return the permutation to its initial value.

Example 1:


You are given a string that contains some bracket pairs, with each pair containing a non-empty key.

  • For example, in the string , there are two bracket pairs that contain the keys and .

You know the values of a wide range of keys. This is represented by a 2D string array where each indicates that key has a value of .

You are tasked to evaluate all of the bracket pairs. When you evaluate a bracket pair that contains some key , you will:

  • Replace and the bracket pair with…

Approach 1:

  • We can have a main thread which will monitor the crontab file for any job additions.
  • As soon as there is a new job added, we can fire a new thread dedicated to that job.
  • This is a very simple approach.
  • However, it suffers from performance issues as a machine can only contain so many threads at a time. …

Omar Faroque

Enterprise Applications Architectecture | JAVA | Rust |Parallel & Distributed Programing | Node.js | IoT | Golang |Starter|Microservices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store