Open in app

Sign In

Write

Sign In

Abrar Shariar
Abrar Shariar

198 Followers

Home

About

Published in Level Up Coding

·Jan 24, 2021

Maximum Even Sum Of K Elements

This is a popular algorithm problem that can be solved with the Greedy Algorithm approach. This is an excellent example to learn how to think in the Greedy Way. In layman’s terms, the greedy way takes the advantage of a locally optimal solution to scale out to a globally optimal…

Python3

4 min read

Maximum Even Sum Of K Elements
Maximum Even Sum Of K Elements
Python3

4 min read


Published in Console.log()

·Nov 8, 2020

Longest substring with the same letters after replacement [Sliding Window]

This is a popular algorithmic problem that involves finding the longest substring containing the same letters after replacing a certain number of letters. The sliding window pattern is employed to solve the problem. Try the problem on educative! Although the solution is pretty descriptive on educative, the lack of visualization…

Algorithms

3 min read

Algorithms

3 min read


Sep 6, 2020

Merging Meeting Times

This is a popular algorithm problem that involves a list of integers which indicate meeting time slots in a calendar. The target is to return a merged list by merging the overlapping time slots. Found it on InterviewCake. Although their descriptive solution was super helpful, the lack of visuals is…

Algorithms

3 min read

Merging Meeting Times
Merging Meeting Times
Algorithms

3 min read


Aug 26, 2020

Recursive function for generating all permutations of an input string — InterviewCake

The problem is borrowed from InterviewCake. Although they did a great job explaining the solution in detail, there aren’t that many visuals. This post is my attempt to visualize the solution: Sample I/O Input: ‘cat’ output: {‘cat’, ‘atc’, ‘act’, ‘tca’, ‘tac’, ‘cta’} The Pattern: Let’s start small. With 2 chars only. Suppose we had…

Algorithms

2 min read

Recursive function for generating all permutations of an input string — InterviewCake
Recursive function for generating all permutations of an input string — InterviewCake
Algorithms

2 min read


Published in Level Up Coding

·Aug 20, 2020

You have a list of integers, and for each index, you want to find the product of every integer except the integer at that index — InterviewCake

This problem is straight outta InterviewCake. Attempted to solve it but got stuck and eventually looked into the solution. Sadly, the solution wasn’t visual enough for me, although it was pretty descriptive. …

Programming

3 min read

You have a list of integers, and for each index, you want to find the product of every integer…
You have a list of integers, and for each index, you want to find the product of every integer…
Programming

3 min read


Published in Console.log()

·Jun 24, 2020

Nested reduce() in JS

Sample data structure:

JavaScript

1 min read

JavaScript

1 min read


Published in Console.log()

·May 15, 2020

Leetcode 1019: Finding the next greatest node — the Domino effect

Hack it yourself! The Problem and example I/O: The problem statement is to find the next greatest element in a linked List. So for the ith node we have to find the jth node, such that node value of j is greater than ith. The catch here is that we have to find the most…

Python3

3 min read

Leetcode 1019: Finding the next greatest node — the Domino effect
Leetcode 1019: Finding the next greatest node — the Domino effect
Python3

3 min read


Published in Console.log()

·Mar 31, 2020

Light More Light, UVa — 10110

Try it yourself on UVa. It’s Fun! This problem has also been part of the programming challenges on the Algorithm Design Manual’s chapter 2. The Premise The premise of the problem can be chalked out like this way: A guy goes along corridor N times which have N bulbs Every time he…

Code

2 min read

Code

2 min read


Published in Console.log()

·Mar 29, 2020

Minimum Number of Swaps to Sort an Array of consecutive integers

Well, the title speaks for itself! Try it yourself on HackerRank Apparently this is quite a common interview question (asked at Google Phone Screen). Sadly, I couldn’t find some good visualizations to understand the underlying logic behind the solving this problem. So, I couldn’t help but write one for myself. …

Algorithms

2 min read

Minimum Number of Swaps to Sort an Array of consecutive integers
Minimum Number of Swaps to Sort an Array of consecutive integers
Algorithms

2 min read


Published in Console.log()

·Mar 12, 2020

Using $auth module’s redirect in tandem with $router.push in Nuxt.js

Recently I came across the issue of using the auth module in Nuxt.js and invoking a $router.push in subsequent line of code in the same method. The conundrum began when the lines after the auth.loginWith method did not execute as intended since the page was redirected to the redirect URI. …

Vuejs

2 min read

Using $auth module’s redirect in tandem with $router.push in Nuxt.js
Using $auth module’s redirect in tandem with $router.push in Nuxt.js
Vuejs

2 min read

Abrar Shariar

Abrar Shariar

198 Followers

Techie | Engineer | Coder

Following
  • Tim Denning

    Tim Denning

  • 胡家維 Hu Kenneth

    胡家維 Hu Kenneth

  • The Educative Team

    The Educative Team

  • Michael Galarnyk

    Michael Galarnyk

  • iOS Alchemist

    iOS Alchemist

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech