Problem statement:
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and return the new length.

Since the array is sorted, this problem boils down to finding unique elements in the array and putting them at adjacent indices.

We will use 2 variables to keep track of following information:
i: elements to the left of i (including i) are unique elements
j: iterator to find unique elements
return i+1 as the result

Problem statement:
Given two axis-aligned rectangles rec1 and rec2, return true if they overlap, otherwise return false.
An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner.

There are 2 primary checks to be done:

  1. If at least one of the rectangle has 0 area (a line), return false (no overlap).
  2. If rectangles lie to the left/right of each other or up/down with respect to each other, return false.

In other cases, return true.

Problem statement:
Given an integer x, return true if x is palindrome integer.
An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.

A palindromic number is a number that remains the same when its digits are reversed.

Few examples:
121: reverse is 121 //palindrome
-121: reverse is 121- //not a palindrome (not even a number)

Different cases:
1. If number is negative, it cannot be a palindrome.
2. If unit digit (rightmost digit) of number is 0 and x != 0, it’s not a palindrome. …

Craft is something which could be very personal to an artist. We all know many “guitarists/musicians” who played while they had an audience in their college/office, but ended up leaving their craft once the audience left. The intention is everything when it comes to craft. Why are you doing what you are doing?

No individual has ever claimed the benefits of becoming a master at a craft. If someone claims to be a master at something, cockiness ends up taking them down somewhere along the road.

Peter Erskine is one of the greatest drummer. He recently released a series named…

Do you remember what Dr. House said about humanity in the first episode while diagnosing if a tumor is there? No one does.

Very rarely does it happen that a TV show hits me. I rarely manage to get time to pick a TV show (Game of Thrones, Narcos, and Big Bang Theory being the exceptions). This one hit me really hard last week. I was watching S01E05 from “This Is Us” and what Manny said towards the end of the episode grabbed my attention the same way “Paris Agreement” captured the world.

I do not wish to write in…

It doesn’t help anyone, to keep schlepping along the edges, slowly and slowly, keeping an eye on the hierarchy structure.

It doesn’t help an effective person to utilize what he/she is REALLY capable of doing.

Schlepping eats you from the inside, without you being aware of. Slowly and slowly, you get into a mode of being schlepped by external factors. This is where we help in generating a multi-billion dollar industry, better known as the medical industry.

It’s acceptable to schlep, but in your own carved out vision and path.

Rather than asking whether we are schlepping or not, we need to ask where are we schlepping towards!

Driving in hills, long road stretches, savouring my thought process on how the universe is computable and music piece that I am working on, playing Ukulele on road trips, designing my next drum lesson; this pretty much sums up my life in broad sense. How I feel secure about my future is by telling myself, “What could possibly go wrong in my life? I could any day drive a car for a rich person and take him/her to trips”.

The way I usually plan my vacation trip is Google out the craziest places to visit and keep a checklist of…

Imagine a dexterous entrepreneur in his/her early startup days, looking for someone to believe in their startup even if they themselves do not. Wait, what?

Hotshot world likes to call it seed funding to sound quick witted about business.

Raising money for your startup is never fun. Many founders would rather prefer going for Bungee Jumping without any body harness than trying to convince an already hesitant investor to believe in their ideas which they themselves aren’t sure about and try to match the frequency of their unfamiliar bandwidth.

Early Stage Investment VS Seed Funding

Seed funding refers to the…

Life can be really hard sometimes. I am 24 today. I have decided to give up.
Yes. I have decided to give up on my comfort zone. A zone that I have unknowingly created in recent time towards learning Mathematics and Computer Science.

I have never seen myself as a Computer Science and Mathematics major who does Music. In fact, I have always considered myself as a Music major who does Computer Science and Mathematics. I have my own selfish reasons for this. Music allows me to be creative. So does Writing. Philosophy, Computer Science and Mathematics make me smart…

I turned 24 in December 2016. Statistically speaking, I might die by the end of the day or year but my guess is it won’t happen. Not that I am depressed. But I feel that I have done a good job in these 24 years.

One thing I do not like about myself is in past 2 years, I have become more of an instrument player and have kept music learning aside. Now what is that supposed to mean?

I believe that people often delude themselves in playing an instrument rather than trying to understand music. Being able to play…

Raman Trehan

● I play/teach drums ● Write scalable software systems ● Design product/business ideas

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