# 100 Days Challenge Leetcode

## Leet Code : Add Two List – Java | CPP | Javascript | Python

You are given two non-empty linked lists that each represent a non-negative integer. The digits are kept in reverse order, with each node containing only one digit. Add the two numbers together and return the total as a linked list. Except for the number 0 itself, you may presume that the two numbers do not […]

## Leet Code : Median of two sorted array -CPP || java || Python || Java Script

Provide the median of the two sorted arrays given two sorted arrays of sizes m and n, respectively. The entire complexity of the run time should be O(log (m+n)). Eg 1: Numbers1 = [1,3], Numbers2 = [2] Result: 2.00000 Explanation: the merged array equals [1,2,3], and the median is 2. Eg 2: Numbers1 = [1,2],

## leet code 1. Two sum (easy)

Leet Code 1. Two Sum : Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “two sum ” or “Leet Code .1‘ Time Complexity: C++: 1. Brute Force Approach: LeetCode 15 : Three (3) Sum Notice: This approach has a time complexity of

## Leet Code :Linked List Cycle II Java || Python || C++ solution

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail’s next pointer is connected

## leet Code : Validate Binary Search Tree Java || C++ || C || pYthon

Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: Example 1: Input: root = [2,1,3] Output: true Solution

## Leet Code :Running Sum of 1d Array Solution C++ || Python || Java

Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Input: nums = [1,2,3,4] Output: [1,3,6,10] Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4]. Example 2: Input: nums = [1,1,1,1,1] Output: [1,2,3,4,5] Explanation: Running sum is obtained as follows: [1, 1+1,

## leet code median of two sorted array Java ,C++ ,C, JS solution

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2: Input: nums1 = [1,2], nums2 = [3,4] Output: 2.50000 Explanation: merged array = [1,2,3,4]

## Leet Code: Rotate Array C++ Python || JavaScript || Java solution:

Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4] Example 2: Input: nums = [-1,-100,3,99], k = 2 Output:

## Leet Code : Merge k Sorted Lists C++ , Java , Python solution

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. Example 1: Input: lists = [[1,4,5],[1,3,4],[2,6]] Output: [1,1,2,3,4,4,5,6] Explanation: The linked-lists are: [ 1->4->5, 1->3->4, 2->6 ] merging them into one sorted list: 1->1->2->3->4->4->5->6 Example 2: Input: lists = [] Output:

## Leet Code : Reverse Nodes in k-Group Java, Python ,C++ JavaScript Solution￼

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is. You

## Leet Code : longest common prefix string C++ ,java , Python Solution

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: strs = [“flower”,”flow”,”flight”] Output: “fl” Example 2: Input: strs = [“dog”,”racecar”,”car”] Output: “” Explanation: There is no common prefix among the input strings. Java Solution C++ solution