When I met people outside Odisha mostly in north India, believe me, most of them don’t know where exactly Odisha is. They will simply say “ somewhere beside West Bengal”. They are even confused between Odissi & odia . They think Odissi is our mother tongue.

So here are some misconception about Odisha what others think about-

  • Firstly, most non-Odia pronounces Odisha as Udisha. Guys, it’s “O” not “U”
  • Secondly, In 2011 the name of state Orissa became Odisha. So stop calling Urissa.
  • I think it’s a nationwide belief that Odisha is the most poverty-stricken state. It’s a huge misconception…


Given an array of integers where the ith integer represents the price of the stock on day i, return the largest possible profit from completing one transaction (i.e. buying 1 share and selling 1 share).
Examples: Given the following prices…

// Buy on day 1 and sell on day 5 for a profit of 5 - 1 = 4. 
prices = [1, 2, 3, 4, 5], return 4.
// Buy on day 4 and sell on day 9 for a profit of 11 - 1 = 10.
prices = [4, 5, 2, 1, 6, 10, 4, 9, 11], return 10…

Let’s talk about a classical computer science algorithm and how it can help you avoid getting burned or your jaws mutilated from teeth chattering on a cold morning. It can also help you quickly find words in a dictionary (if you still have one lying around), and solve many other daily life issues with minimal effort.

We’ll use searching a word in a dictionary as an example. Searches often have a “search space”, which are the confinements of where our answer could be. At the beginning, the whole dictionary is our “search space”. Our aim is to keep reducing this…


Are complex algorithms relevant in the real world?

INTERNSHIP PROJECT

Hackerrank, 2019.

My friend was drawing on the board while I looked on. We were in different teams, each assigned a project. His program currently took 5 hours to execute. The requirement stated one hour. As the ‘algorithm enthusiast’, I was called for help.

The program was to find the friends of all users in a social network. After explaining the use-case, my friend showed me his approach. I was very determined to find an optimization, hence I did. Immediately.

“An adjacency matrix?! No, use an adjacency list. The execution time will reduce in your case to O(N). Or you…


Imagine you’re the engineer responsible for building Reddit from the ground up. Walk me through how you would design the system to support the following functionality:

Requirements:

  • Users can make posts in different forums (i.e. “subreddits”)
  • Users can attach images to their posts
  • Users can upvote or downvote posts
  • Users can add comments to posts
  • Users can see a feed of posts sorted by ranking or recency

Constraints:

  • We want to support a large volume of users (millions) viewing and posting content

Hints

Think about the core components that you’ll need, and then dive deeper into them. What kind of database would you…


Photo by Chris Ried on Unsplash

Sum Root to Leaf Numbers is an interesting problem from LeetCode. The problem is of medium difficulty and is about binary trees. This post is an explained solution to the problem.

I assume that you’re familiar with Python and the concept of binary trees. If you’re not, you can read this article to get started.


A man starts from the north-west (top-left) corner of the land and begins walking towards the center of it, in a spiral manner. As the man moves, he keeps track of the number of trees growing on each block of land and records the counts on his journal until he reaches his destination. This list of numbers is the key to unlock treasures hidden there.

You need to be faster than him. Satellite imagery has already provided you the count of trees on each block of land. …


You’re given an array of integers. Write a function that returns a pair of numbers such that they sum up to zero.

[Alternate problem with a target]

You can assume there will be exactly 1 solution. Each element in the array can only be used once.

Example:

Array of integers is [2, 7, 9, -2].
The pair that sums up to 0 is (2, -2).

Input:
A list of numbers, separated by space.

2 7 9 -2

Output:
2 numbers from the array that sum up to 0.
We will sort the 2 numbers for you so that you can easily compare with our expected output.

-2 2

Solution:

Observe

  1. For a number A, we want to know if such a number B exists, such that A + B…


You’re given a list of integers and a sum, S.

For example:

Array: 1 5 3 4 3
S: 8

Insert, in front of each number, 1 of the 2 symbols, + or -, so that the resulting sum adds up to S.
Write a function that counts all such possibilities.

In the example above, there are 3:

+1 +5 +3 -4 +3
-1 +5 +3 +4 -3
-1 +5 -3 +4 +3

Input: S followed by the list of integers.

Output: The number of possibilities where the sum adds up to S.

Input:
8
1 5 3 4 3

Photo by Christopher Gower on Unsplash

Problem Statement:

In older phones, the keypads are used to type both numbers and letters, as follows:

S7rthak

Software Engineer @Vedantu, Former Intern @Hackerrank, GSoC @Wikimedia, Codeforces(Expert)

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