life is too short for a diary

Most popular

2 min read

Leetcode - All Divisions With the Highest Score of a Binary Array

You are given a 0-indexed binary array nums of length n. nums can be divided at index i (where 0 <= i <= n) into two arrays (possibly empty) numsleft and numsright..

Continue reading → Tags : leetcode hashmap array java python

1 min read

Learning Tennis

Badminton sport has a low learning curve unlike tennis. Even your granny can hit a birdie. I grew up playing badminton but decided to try my luck with tennis. “Playing tennis would be a cakewalk”, I thought. However my hubris was soon deflated...

Continue reading → Tags : tennis recreation badminton sports

1 min read

Leetcode - Longest Substring Without Repeating Characters

In this leetcode problem, we are asked to find the length of the longest string of characters in a provided string that does not contain repeating characters. In other words, in the string abcabcbb the longest substring without repeating characters is abc (with a length of 3)...

Continue reading → Tags : leetcode two pointers set