---
title: "Suraj Yadav (@Suraj26) | Hashnode"
description: "Crawling in the world of Computer Science. Read the latest articles by Suraj Yadav on Hashnode."
url: "https://hashnode.com/@Suraj26"
---

@Suraj26

# Suraj Yadav

@Suraj26 · Joined June 2021

Crawling in the world of Computer Science.

### [3 Sum - LeetCode](https://suraj26.hashnode.dev/3-sum-leetcode?utm_source=hashnode&utm_medium=feed)

The problem is taken from 15. 3Sum. Naive Approach Naive approach would be to go through all possible triplets in the array. And use set data structure to remove duplicates. Code - class Solution { public: vector<vector<int>> threeSum(vector<i...

2 min read · [suraj26.hashnode.dev](https://suraj26.hashnode.dev/3-sum-leetcode?utm_source=hashnode&utm_medium=feed)

[Dec 11, 2021](https://hashnode.com/posts/3-sum-leetcode/61b44d5ab18f1f0c683008c8)

### [Pascal's Triangle - LeetCode](https://suraj26.hashnode.dev/pascals-triangle-leetcode?utm_source=hashnode&utm_medium=feed)

The problem is taken from 118. Pascal's Triangle. Approach Let's make a pascal's triangle of size 5. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 We could see that the very first and the very last eleme...

1 min read · [suraj26.hashnode.dev](https://suraj26.hashnode.dev/pascals-triangle-leetcode?utm_source=hashnode&utm_medium=feed)

[Dec 6, 2021](https://hashnode.com/posts/pascals-triangle-leetcode/61ad995bb6bca85a26d3f07d)

### [Merge Sorted Array - LeetCode](https://suraj26.hashnode.dev/merge-sorted-array-leetcode?utm_source=hashnode&utm_medium=feed)

The problem is taken from 88. Merge Sorted Array. Naive approach In this approach, we use a HashMap(Integer, Integer), where the first place would hold numbers in the array and second place would hold their occurrences. Code - class Solution { pu...

2 min read · [suraj26.hashnode.dev](https://suraj26.hashnode.dev/merge-sorted-array-leetcode?utm_source=hashnode&utm_medium=feed)

[Dec 5, 2021](https://hashnode.com/posts/merge-sorted-array-leetcode/61ac4989b6bca85a26d3db6d)

### [Maximum Sum Contiguous Subarray - LeetCode](https://suraj26.hashnode.dev/maximum-sum-contiguous-subarray-leetcode?utm_source=hashnode&utm_medium=feed)

The problem is taken from 53. Maximum Subarray. Brute force approach For each element in the array we need to find all possible contiguous subarray to the right of it. Code - class Solution { public: int maxSubArray(vector<int>& nums) { ...

3 min read · [suraj26.hashnode.dev](https://suraj26.hashnode.dev/maximum-sum-contiguous-subarray-leetcode?utm_source=hashnode&utm_medium=feed)

[Dec 4, 2021](https://hashnode.com/posts/maximum-sum-contiguous-subarray-leetcode/61ab42fe95cbbe21d3116c8d)

### [Search Insert Position - LeetCode](https://suraj26.hashnode.dev/search-insert-position-leetcode?utm_source=hashnode&utm_medium=feed)

The problem is taken from 35. Search Insert Position. Approach The solution is very straight forward. We need to do binary search on the given array and try to find the target value. But the catch here is, if the target value is not found in the arr...

2 min read · [suraj26.hashnode.dev](https://suraj26.hashnode.dev/search-insert-position-leetcode?utm_source=hashnode&utm_medium=feed)

[Dec 2, 2021](https://hashnode.com/posts/search-insert-position-leetcode/61a85505be456923c52bc7f9)
