life is too short for a diary



Posts Tagged: leetcode (Page 6)

Maximum Subarray

There's an interesting problem I recently solved on leetcode based on dynamic programming. My Github repository contains list of all problems that I have solved. I often start with a brute force approach without fretting about time complexity. Later I try to improve my algorithm for a better efficient solution...

Continue reading → leetcode dp java python



Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists...

Continue reading → programming leetcode code



Three Sum Problem Leetcode Solution

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero...

Continue reading → leetcode two pointers java