

<h1 align ="center">100 Days Coding Challenge</p>
<h3 align = "center">Coding is Fun, Code daily</p>
<h4 align = "center">Code daily , Add your solutions to the Repo by making a pull request, you can also edit/add multiple solutions to the solved problems</h4>
<br>

---



[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fgjbae1212%2Fhit-counter)](https://hits.seeyoufarm.com)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[![GitHub watchers](https://img.shields.io/github/watchers/Naereen/StrapDown.js.svg?style=social&label=Watch&maxAge=2592000)](https://GitHub.com/Naereen/StrapDown.js/watchers/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://GitHub.com/Naereen/ama)
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)


[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![made-for-VSCode](https://img.shields.io/badge/Made%20for-VSCode-1f425f.svg)](https://code.visualstudio.com/)
![](https://img.shields.io/github/commit-activity/m/manvi0308/100DaysOfAlgo)



### Start Coding Today !! The More you code, the more you grow
### Everyone should learn to program, because it teaches you how to think - Steve Jobs
![](Images/dsa.jpg)
![](Images/download.jpg)

Topic | Number of problems solved | Sources<br>
----- | ------------------------- | ------------------------
Arrays | 35                   | Geeks for Geeks, Techiedelight
Linked List |28                   | Geeks for Geeks, InterviewBit
Mathematical Thinking | 34       | Interview Bit, Tutorials Point
Dynamic Programming | 27         | Interview Bit, Elements of programming interview Book
Recusrion      | 15    | GFG
Graphs              | 19          | Programiz, Interview Bit
Tree                | 15           | Elements of programming interview Book
Hashing             | 8          | Techie delight
Hackerrank 30dayschallenge | 30   | Hackerrank
NPTEL Programming In Java Assignment Solutions  | 15   | NPTEL
Total | 226


#### Find the ![RESOURCES](https://github.com/manvi0308/100DaysOfAlgo/tree/master/resources) here

<br>

---
![](Images/100days.jpg)


![Arrays](https://img.shields.io/badge/Topic-Arrays-red)<br>

**Day 1**
1)*Tower of Hanoi*   (Referrals[https://www.geeksforgeeks.org/c-program-for-tower-of-hanoi/] )<br>
2)*N-Queens Problem* (Referrals[https://www.codesdope.com/blog/article/backtracking-explanation-and-n-queens-problem/])
<br>

**Day 2** : 1) *Permutation of a given string*<br>
           2) *Permutation of a given string in lexicographical order*
 <br>

**Day 3**: 1) *Print all possible strings of length k that can be formed from a set of n characters*<br>
           2) *Write a function merge_ranges() that takes a list of multiple meeting time ranges and returns a list of condensed ranges.Meeting is represented as a list having tuples in form of (start time , end time)*<br>

**Day 4**: 1) *Given a list of numbers(maybe positives or negatives) find triplets that equals to a desired sum* <br>
           2) *Given three lists of take out orders, dine in orders and served orders.You need to find whether the service is first come first served
            Problem Statement taken from : Interview Cake*
<br>

**Day 5**: 1) *Chain Matrix Multiplication([https://www.radford.edu/~nokie/classes/360/dp-matrix-parens.html])Go through this link for better understanding of logic working behind the scenes<br>*
2) *Given an array of integers write a functon that returns true if there is a triplet (a, b, c) that satisfies a^2 = b^2+c^2*
<br>

**Day 6**: 1) *Write a function that rotates an arr[] of size n by d elements in left direction*<br>
2) *Write a program to print all leaders in array.An element is leader if its greater than all the elements to its right side.And the rightmost element is always a leader*
<br>

**Day 7**: 1) *Write a program to check whether two numbers are co-prime or not* <br>
2) *Some basic sorting algorithms*
<br>

**Day 8**:  1)*Given a binary String with wildcard characters('?') at some places.Print all the possible binary strings combinations formed by replacing wildcard characters with 0 or 1*<br>
2)*Print all the possible solutions of N Queens Problems*
<br>

**Day 9**:  1)*Python program to generate all binary strings with equal sums in left and right halves.*<br>
2)*Program to print all combination of size r in an array of size n*
<br>

**Day 10**: 1)*Power set in lexicographical order*<br>
2)*Taken from codechef([https://www.codechef.com/problems/LECANDY])*
<br>

**Day 11**: 1)*Count substrings that start and end with same letter*<br>
2)*Count consonants in a string**
<br>

**Day 12**:  1)*Solved chef and notebooks from codechef([https://www.codechef.com/problems/CNOTE])*<br>
2)*Swap Nodes in pairs([https://leetcode.com/problems/swap-nodes-in-pairs])*
<br>

**Day 13**:  1)*Quadruplets with a given sum*<br>
2)*Minimum number possible after k swaps*
<br>

**Day 14**:  1)*Kadane's algorithtm*<br>
2)*Given two sorted arrays X[] and Y[] of size m and n where m>=n and X[] has exactly n vacant positions, merge elements of Y[] in their correct position in array X[] i.e.merge
X[] and Y[] by maintaining the sorted order
<br>

---

![Topic](https://img.shields.io/badge/Topic-Linked%20List-red)<br>

**Day 15**: 1)*Linked list insertion*<br>
2)*Counting number of nodes in a Linked list iteratively*
<br>

**Day 16**1)*Deleting nodes in a linked list*<br>
2)*To get the Nth node in a Linked list*
<br>

**Day 17**1)*Counting number of times a particular node occurs in a singly linked list*<br>
2)*Write a program to get the Nth node from last in a singly linked list*<br>
3)*Function to reverse a singly linked list*
<br>

**Day 18**1)*Reverse Specified Portion of a Linked list*<br>
2)*Write a program to find the middle element of linked list*
<br>

**Day 19**1)*Given a singly linked list, whose nodes represent digits of a number, add a single digit number to it.*<br>
2)*Remove duplicates from singly linked sorted list*
<br>

**Day 20**1)*Given a singly linked list, check whether the linked list is palindrome or not*<br>
2)*Added a new file named "Algorithms", added some basics like sorting algorithms in it
<br>

**Day 21**1)*Doubly linked list -all methods of insertion*
<br>

**Day 22**1)*Insertion sort in a singly linked list*<br>
2)* Add two linked list without using any extra space*
<br>

**Day 23**1)*Removing redundant nodes in a linked list*
<br>

**Day 24**1)*Intersection of linked list*
<br>

**Day 25**1)*Seggregate even ond odd nodes in a linked list*
<br>

**Day 26**1)*Reordering a linked list*(https://www.interviewbit.com/problems/reorder-list/)
<br>

**Day 27**1)*Partitioning a given linked list(https://www.interviewbit.com/problems/partition-list/)
<br>

**Day 28**1)Sort Binary linked list(https://www.interviewbit.com/problems/sort-binary-linked-list/)<br>
2)*Prime sum*(https://www.interviewbit.com/problems/-sumprime/)
<br>

---

![Topic](https://img.shields.io/badge/Topic-Mathematical%20Approach-red)<br>


**Day 29**1)*Sum of pairwise hamming distances*
<br>

**Day 30**1)*Fizzbuzz*  (https://www.interviewbit.com/problems/fizzbuzz/)
<br>

**Day 31**1)*Number of length N and Value K*(https://www.interviewbit.com/problems/numbers-of-length-n-and-value-less-than-k/)
<br>

**Day 32**1) *A items are to be delivered in a circle of size B.<br>
Find the position where the Ath item will be delivered if we start from a given position C.(https://www.interviewbit.com/problems/distribute-in-circle/)*
<br>

**Day 33**1) *Largest Coprime divisor*<br>
2) *Trailing zeroes in factorial of number*
<br>

**Day 34**1) *Excel column title*<br>
2) *Next Similar Number*<br>

**Day 35**  *1) Step By Step(https://lnkd.in/dWAqGSf)* <br>
*2) Chef and Card Game(https://lnkd.in/dtHxACG)*
<br>

**Day 36** 1)*1) Given a string, find the rank of the string amongst its permutations sorted lexicographically. Assume that no characters are repeated.*<br>
2) *Chef and Rainbow Array(taken from Codechef)*<br>

**Day 37** 1)* Rearrange a given array so that arr[i] becomes arr[arr[i]] with O(1) extra space, assume that all elements are in the range of [0, N-1] and N*N doesn't overflow*<br>

**Day 38**  *1) Given an integer A you need to find the Ath fibonacci number modulo 10^9 + 7.(https://lnkd.in/gXvFzSV)*<br>
*2)Implementation of stack using arrays*
<br>

**Day 39** 1)* Given an array, find the nearest smaller element G[i] for every element A[i] in the array such that the element has an index smaller than i.

More formally,

    G[i] for an element A[i] = an element A[j] such that 
    j is maximum possible AND 
    j < i AND
    A[j] < A[i]*
    <br>
    
**Day 40**  *1) Linked list implementation of Stack*
<br>

**Day 41** *1)Implement two stacks using single array*<br>
*2) Program to sort an array using Stack*
<br>

**Day 42** *1) Fibonacci series using Memoization*<br>
*2) Fibonacci Number using Tabulated(bottom-up) version*
<br>

**Day 43** *1)  Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or positive-negative-positive) subarray present in the array.*
<br>

**Day 44** *1)Solved some mcq's from interview bit*
<br>

---

![Topic](https://img.shields.io/badge/Topic-Dynamic%20Programming-red)<br>
**Day 45**  *1) Matrix Chain Multiplication* <br>
*2) Maximum value from a given sequence of coins*
<br>

**Day 46** *1) Find total ways to reach the nth stair from bottom* <br>
*2) Minimum number of deletions required to convert a string to palindrome*
<br>

**Day 47** *1) Given two strings A and B. Find the longest common sequence ( A sequence which does not need to be contiguous), which is common in both the strings.
You need to return the length of such longest common subsequence.*
<br>

**Day 48** *1)Longest Palindromic Sequence*
<br>

**Day 49** *1)To find the Nth bell number [Let S(n, k) be total number of partitions of n elements into k sets. The value of n’th Bell Number is sum of S(n, k) for k = 1 to n]
*
<br>

**Day 50** *1)Min sum path formed by 2d Matrix*
<br>

**Day 51**  *1) Given a string A, find length of the longest repeating sub-sequence such that the two subsequence don’t have same string character at same position,
i.e., any i’th character in the two subsequences shouldn’t have the same index in the original string.*
<br>

**Day 52** *1) Given two strings A and B, find the minimum number of steps required to convert A to B. (each operation is counted as 1 step.)[Levenshtein Distance]*
<br>

**Day 53** *1) Largest Area of Rectangle with Permutations(Given a binary grid A of size N x M consisting of 0's and 1's, find the area of the largest rectangle inside the grid such that all the cells inside the chosen rectangle should have 1 in them.
You are allowed to permutate the columns matrix i.e. you can arrange each of the column in any order in the final grid.*
<br>

**Day 54** *1) Ways to reach the bottom right corner of a matrix with exactly K turns allowed.*
<br>

---

![Topic](https://img.shields.io/badge/Topic-Graphs-red)
<br>

**Day 55** *1)Representation of graphs using Adjacency List**
<br>

**Day 56** *1)Breadth First Search in Graphs*
<br>

**Day 57** *1) Depth First Traversal of Graph* <br>
2) Depth First Traversal for handling disconnected graphs.
<br>

**Day 58** *1)Dijkstra's Algorithm*<br>

**Day 59** *1)Kruskal's Minimum Spanning Tree Algorithm*<br>

**Day 60** *1)Topological Sorting for Directed Acyclic Graph*<br>

**Day 61** *1)Given an directed graph having A nodes labelled from 1 to A containing M edges given by matrix B of size M x 2such that there is a edge directed from node
B[i][0] to node B[i][1].
Find whether a path exists from node 1 to node A.
Return 1 if path exists else return 0.*
<br>

**Day 62**  *)Graph coloring Problem*<br>

---
![](https://img.shields.io/badge/Topic-Trees-red)
<br>
**Day 63**  *1) Insertion in binary tree where level order traversal is given *<br>

**Day 64**  *1)To find binary tree with given inorder traversal*<br>
*2) To find height of binary tree from inorder and levelorder traversals.*
<br>

**Day 65**  *1) Diagonal traversal of binary tree*<br>
*2) Find nth node in postorder traversal of binary tree*
<br>

**Day 66**  *1)Check if a binary tree is height balanced or not.*<br>

**Day 67**  *1)Find Kth smallest element in Binary Search Tree*
<br>

**Day 68**  *1)Revisited Some basic concepts of Trees *
<br>

**Day 69**  *1)Check if two node are in same subtrees of the root node.*
<br>

**Day 70**  *1)Implementation of AVL Trees*
<br>

**Day 71**  *1)Deletion in AVL trees*
<br>

**Day 72**  *1)Remove invalid parenthesis in an expression*
<br>

---
![Topic](https://img.shields.io/badge/Topic%20-Hashing-red)
<br>

**Day 73**  *1) Given a limited range array contains both positive and non-positive numbers, i.e., elements are in the range from -MAX to +MAX. Search if some number is present in the array or not in O(1) time*
<br>

*2)Sorting using trivial hash function.*
<br>

**Day 74** *1) Given an array of integers, find two numbers such that they add up to a specific target number.<br>
2) Union and intersection of two linked lists.*
<br>

**Day 75**  *1) Vertical sum in binary tree <br>
2) Given an array of integers, find the length of the longest sub-sequence such that elements in thesubsequence are consecutive integers, the consecutive numbers can be in any order.*
<br>

**Day 76**  *1)Given an array with distinct elements, the task is to find the pairs in the array such that a % b = k, where k is a given integer.*<br>
*2)Given an array of n integers, find the sum of f(a[i], a[j]) of all pairs (i, j) such that (1 <= i < j <= n).*
<br>

**Day 77** *1) Given an array, count pairs in the array such that one element of pair divides other<br>
2)Given two arrays with size n, maximize the first array by using the elements from the second array such that the new array formed contains n greatest but unique elements of both the arrays giving the second array priority
<br>

**Day 78**  *1)Implemented FCFS Scheduling Algorithm in Python.*<br>

**Day 79**  *1) Fibonacci series using two variables<br>
2) Given two numbers M and N, the task is to check if the M-th and N-th Fibonacci numbers perfectly divide each other or not.
<br>

**Day 80**  *1) Given an array and k, we need to find the minimum operations needed to make GCD of the array equal or multiple of k. Here an operation means either increment or decrements an array element by 1.*
<br>

![](https://img.shields.io/badge/Topic-Miscellaneous-red)

**Day 81**  *1) Finding determinant of 2D Matrix* <br>
*2) Rotate square matrix by 90 degrees* <br>

**Day 82**  *1)Kosaraju's algorithm*<br><br>

**Day 83 and 84**  *1) Connecting Soldiers (https://www.codechef.com/problems/NOKIA)*<br>
2) Fit squares in Triangle(https://www.codechef.com/problems/TRISQ)
<br>

**Day 85**   *1)Revision Day**
<br>

**Day 86**  *1) Linear Diophantine equations*<br>
*2)Sieve of eratosthenes*
<br>

**Day 87**  *1)Construct a height balanced BST from an unbalanced BST.*
<br>

**Day 88**  *1) Given a string and a pattern containing wildcard characters, write an efficient algorithm to check if input stringmatches with wildcard pattern or not*
<br>

**Day 89**  *1)Given a collection of numbers, return all possible permutations.<br>
*2) Given two integers n and k, return all possible combinations of k numbers out of 1 2 3 ... n.*
<br>

**Day 90**  *1) Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.*<br>
*2) Given an integer array A of size N consisting of unique integers from 1 to N. You can swap any two integers atmost B times.Return the largest lexicographical value array that can be created by executing atmost B swaps.*
<br>

**Day 91**  *1) Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. <br>
*2) Given an integer array A of size N consisting of unique integers from 1 to N. You can swap any two integers atmost B times.Return the largest lexicographical value array that can be created by executing atmost B swaps.*
<br>

**Day 92**  *1) Find all possible combinations of words formed from mobile keypad.*<br>
*2) Print all distinct subsets of given set.*
<br>

**Day 93**  *1) The set [1,2,3,…,n] contains a total of n! unique permutations .Given n and k, return the kth permutation sequence.*<br>
2) Given a string s, partition s such that every string of the partition is a palindrome
<br>

**Day 94** *1) Given a staircase, find total number of ways to reach the n’th stair from bottom of the stair when a person is only allowed to climb either 1 or 2 or 3 stairs at a time.*<br>

*2) Given n stairs and we have 2 colour yellow and green the task is that we have to paint given stairs by given colour with condition is that we cannot paints two yellow steps directly after each other.*
<br>

**Day 95**  *1)Given a string, a partitioning of the string is a palindrome partitioning if every substring of the partition is a palindrome. For example, “aba|b|bbabb|a|b|aba” is a palindrome partitioning of “ababbbabbababa”*<br>

**Day 96**  *1)1) Given a encoded binary string and a Huffman MinHeap tree, your task is to complete the function decodeHuffmanData(), which decodes the binary encoded string and return the original string.*
<br>

**Day 97**  *1) Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks in the given sequence such that the lines are printed neatly. Assume that the length of each word is smaller than the line width.*
<br>

**Day  98**  *1) Given three numbers a, b and k, find k-th digit in ab from right side*<br>
*2) Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once.*
<br>

**Day 99**  *1)Minimum weight triangulation of convex polygon.*
<br>

**Day 100**  *1)Added resources for all*







[![ForTheBadge built-with-swag](http://ForTheBadge.com/images/badges/built-with-swag.svg)](https://GitHub.com/Naereen/)

