{"id":25186691,"url":"https://github.com/iamakkkhil/dailycoding","last_synced_at":"2025-05-07T14:29:42.528Z","repository":{"id":228105889,"uuid":"294115015","full_name":"iamakkkhil/DailyCoding","owner":"iamakkkhil","description":"Just a fun challenge for me. Trying to maintain a consistent streak on Github by solving one coding challenge every day.","archived":false,"fork":false,"pushed_at":"2021-09-30T13:27:10.000Z","size":364,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T11:01:35.802Z","etag":null,"topics":["100daysofcode","30daysofcode","365daysofcode","complexity","constraints","daily-coding-problem","dailycoding","repeated-elements"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamakkkhil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-09-09T13:03:36.000Z","updated_at":"2022-09-05T18:26:03.000Z","dependencies_parsed_at":"2024-03-17T05:53:46.409Z","dependency_job_id":"250ea8fc-b706-42df-bf3b-60460e8fdcab","html_url":"https://github.com/iamakkkhil/DailyCoding","commit_stats":null,"previous_names":["iamakkkhil/dailycoding"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamakkkhil%2FDailyCoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamakkkhil%2FDailyCoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamakkkhil%2FDailyCoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamakkkhil%2FDailyCoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamakkkhil","download_url":"https://codeload.github.com/iamakkkhil/DailyCoding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252895254,"owners_count":21821132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["100daysofcode","30daysofcode","365daysofcode","complexity","constraints","daily-coding-problem","dailycoding","repeated-elements"],"created_at":"2025-02-09T19:43:55.732Z","updated_at":"2025-05-07T14:29:42.501Z","avatar_url":"https://github.com/iamakkkhil.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DailyCoding\n\n## DAY 1: Exactly 3 Divisors.\nhttps://www.geeksforgeeks.org/numbers-exactly-3-divisors/\n\n**QUESTION** : Given a number N, print all numbers in the range from 1 to N having \nexactly 3 divisors.\n\nExpected Time Complexity : O(N1/2 * N1/4) \u003cbr /\u003e\nExpected Auxilliary Space :  O(1)\n\nConstraints :\n1 \u003c= N \u003c= 10\u003csup\u003e9\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_1.py)\n\n\n\n## DAY 2: Modular Multiplicative Inverse.\nhttps://www.geeksforgeeks.org/multiplicative-inverse-under-modulo-m/\n\n**QUESTION** : Given two integers ‘a’ and ‘m’. The task is to find the smallest modular \nmultiplicative inverse of ‘a’ under modulo ‘m’. If the modular multiplicative inverse \ndoesn't exist return -1.\n\nExpected Time Complexity : O(m) \u003cbr /\u003e\nExpected Auxilliary Space : O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= a \u003c= 10\u003csup\u003e4\u003c/sup\u003e \u003cbr /\u003e\n1 \u003c= m \u003c= 10\u003csup\u003e4\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_2.py)\n\n\n\n## DAY 3: First Repeating Element.\nhttps://www.geeksforgeeks.org/find-first-repeating-element-array-integers/\n\n**QUESTION** : Given an array of integers, find the first repeating element in it. We need \nto find the element that occurs more than once and whose index of first occurrence \nis smallest. If there is no such element, return -1.\n\nExpected Time Complexity: O(NlogN) \u003cbr /\u003e\nExpected Auxilliary Space: O(N)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e6\u003c/sup\u003e \u003cbr /\u003e\n0 \u003c= A\u003csub\u003ei\u003c/sub\u003e \u003c= 10\u003csup\u003e6\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_3.py)\n\n\n\n## DAY 4: Rearrange an array with O(1) extra space.\nhttps://www.geeksforgeeks.org/rearrange-given-array-place/\n\n**QUESTION** : Given an array arr[] of size N where every element is in the range \nfrom 0 to n-1. Rearrange the given array so that arr[i] becomes arr[arr[i]].\n\nExpected Time Complexity: O(N) \u003cbr /\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e7\u003c/sup\u003e \u003cbr /\u003e\n0 \u003c= Lst[i] \u003c N\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_4.py)\n\n\n\n## DAY 5: Trapping rain water.\nhttps://www.geeksforgeeks.org/trapping-rain-water/\n\n**QUESTION** : Given n non-negative integers representing an elevation map where\nthe width of each bar is 1, compute how much water it is able to trap after raining.\n\nExpected Time Complexity: O(N) \u003cbr /\u003e\nExpected Auxilliary Space: O(N)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e7\u003c/sup\u003e \u003cbr /\u003e\n0 \u003c= A\u003csub\u003ei\u003c/sub\u003e \u003c 10\u003csup\u003e8\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_5.py)\n\n\n## DAY 6: Merge two sorted arrays with O(1) extra space.\nhttps://www.geeksforgeeks.org/merge-two-sorted-arrays-o1-extra-space/\n\n**QUESTION** : Given two sorted arrays arr1[] and arr2[] of sizes N and M in non-decreasing order. \nMerge them in sorted order without using any extra space. Modify arr1 so that it contains the first N elements \nand modify arr2 so that it contains the last M elements.\n\nExpected Time Complexity:  O((n+m) log(n+m)) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= X, Y \u003c= 5*10\u003csup\u003e4\u003c/sup\u003e \u003cbr /\u003e\n0 \u003c= arr1\u003csub\u003ei\u003c/sub\u003e, arr2\u003csub\u003ei\u003c/sub\u003e \u003c= 10\u003csup\u003e9\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_6.py)\n\n\n## DAY 7: Search an element in sorted and rotated array.\nhttps://www.geeksforgeeks.org/search-an-element-in-a-sorted-and-pivoted-array/\n\n**QUESTION** : Given a sorted and rotated array A of N distinct elements which is rotated at some point, \nand given an element K. The task is to find the index of the given element K in the array A. If the \nelement is not present, then return -1.\n\nExpected Time Complexity:  O(logN) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N ≤ 10\u003csup\u003e7\u003c/sup\u003e \u003cbr /\u003e\n0 ≤ A\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e8\u003c/sup\u003e \u003cbr /\u003e\n1 ≤ K ≤ 10\u003csup\u003e8\u003c/sup\u003e \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_7.py)\n\n\n## DAY 8: Merge Sort.\nhttps://www.geeksforgeeks.org/merge-sort/\n\n**QUESTION** : Merge Sort is a Divide and Conquer algorithm. \nIt repeatedly divides the array into two halves and combines them in sorted manner.\n\nExpected Time Complexity: O(N) for the merge function only \u003c/br\u003e\nExpected Auxilliary Space: O(N)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N ≤ 10\u003csup\u003e5\u003c/sup\u003e \u003cbr /\u003e\n0 ≤ arr[i] ≤ 10\u003csup\u003e3\u003c/sup\u003e \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_8.py)\n\n\n## DAY 9: Union of Two Sorted Arrays.\nhttps://www.geeksforgeeks.org/union-and-intersection-of-two-sorted-arrays-2/\n\n**QUESTION** : Union of two arrays can be defined as the common and distinct \nelements in the two arrays.\nGiven two sorted arrays of size N and M respectively, find their union.\n\nExpected Time Complexity: O(N+M) \u003c/br\u003e\nExpected Auxilliary Space: O(N+M)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N, M ≤ 10\u003csup\u003e5\u003c/sup\u003e \u003cbr /\u003e\n0 ≤ arr1[i], arr[2] ≤ 10\u003csup\u003e6\u003c/sup\u003e \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_9.py)\n\n\n## DAY 10: Intersection of Two Sorted Arrays.\nhttps://www.geeksforgeeks.org/union-and-intersection-of-two-sorted-arrays-2/\n\n**QUESTION** : The intersection of two arrays contains the elements common to both the arrays. \nThe intersection should not count duplicate elements.\nGiven two sorted arrays arr1[] and arr2[] of sizes N and M respectively. Find their intersection.\n\nExpected Time Complexity: O(N+M) \u003c/br\u003e\nExpected Auxilliary Space: O(N+M)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N, M ≤ 10\u003csup\u003e5\u003c/sup\u003e \u003cbr /\u003e\n0 ≤ arr1[i], arr[2] ≤ 10\u003csup\u003e6\u003c/sup\u003e \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_10.py)\n\n\n## DAY 11: Minimum number of swaps required to sort an array.\nhttps://www.geeksforgeeks.org/minimum-number-swaps-required-sort-array/\n\n**QUESTION** : Given an array of n distinct elements, find the minimum number of swaps required to sort the array.\n\nExpected Time Complexity: O(N+M) \u003c/br\u003e\nExpected Auxilliary Space: O(N+M)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N, M ≤ 10\u003csup\u003e5\u003c/sup\u003e \u003cbr /\u003e\n0 ≤ arr1[i], arr[2] ≤ 10\u003csup\u003e6\u003c/sup\u003e \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_11.py)\n\n\n## DAY 12: Repeatedly search an element by doubling it after every successful search.\nhttps://www.geeksforgeeks.org/repeatedly-search-element-doubling-every-successful-search/\n\n**QUESTION** : Given an array “a[]” and integer “b”. Find whether b is present in a[] or not. \nIf present, then double the value of b and search again. We repeat these steps until b is not found. \nFinally we return value of b.\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_12.py)\n\n\n## DAY 13: Minimum Number of Platforms Required for a Railway/Bus Station.\nhttps://www.geeksforgeeks.org/minimum-number-platforms-required-railwaybus-station/\n\n**QUESTION** : Given arrival and departure times of all trains that reach a railway station, \nthe task is to find the minimum number of platforms required for the railway station so that no train waits. \nWe are given two arrays which represent arrival and departure times of trains that stop.\n\nExpected Time Complexity: O(N log N) \u003c/br\u003e\nExpected Auxilliary Space: O(N)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 1000  \u003c/br\u003e\n1 \u003c= A[i] \u003c D[i] \u003c= 2359   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_13.py)\n\n\n## DAY 14: Median of Two sorted arrays.\nhttps://www.geeksforgeeks.org/median-of-two-sorted-arrays-of-different-sizes/\n\n**QUESTION** : Given two sorted arrays of sizes N and M respectively. The task is to find \nthe median of the two arrays when they get merged. If there are total even elements, return \nfloor of average of middle two elements.\n\nExpected Time Complexity: O(log(max(m,n))) \u003c/br\u003e\nExpected Auxilliary Space: O(N)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N, M \u003c= 10\u003csup\u003e6\u003c/sup\u003e  \u003c/br\u003e\n1 \u003c= arr[i], brr[i] \u003c= 10\u003csup\u003e7\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_14.py)\n\n\n## DAY 15 : Sort an array of 0s, 1s and 2s.\nhttps://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/\n\n**QUESTION** : Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that \nsorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.\n\nExpected Time Complexity: O(N) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n1 \u003c= A[i] \u003c= 2 \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_15.py)\n\n\n## DAY 16 : Different Operations on Matrices.\nhttps://www.geeksforgeeks.org/different-operation-matrices/\n\n**QUESTION** : Perform Addititon, Subtraction and Multiplication on given Matrices.\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_16.py)\n\n\n## DAY 17 : Minimize the maximum difference of adjacent elements after at most K insertions.\nhttps://www.geeksforgeeks.org/minimize-the-maximum-difference-of-adjacent-elements-after-at-most-k-insertions/\n\n**QUESTION** : Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that \nsorts the given array. The functions should put all 0s first, then all 1s and all 2s in last.Given an array \nof N elements, the task is to minimize the maximum difference of adjacent elements by inserting at most K \nelements in the array.\n\nConstraints: \u003cbr /\u003e\nT \u003c= 100   \u003cbr /\u003e\n2 \u003c= n \u003c= 10\u003csup\u003e4\u003c/sup\u003e   \u003cbr /\u003e\n1 \u003c= arr[i] \u003c= 10\u003csup\u003e3\u003c/sup\u003e   \u003cbr /\u003e\n1 \u003c= k \u003c= 10\u003csup\u003e5\u003c/sup\u003e   \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_17.py)\n\n\n## Day 18: Determinant of a matrix.\nhttps://www.geeksforgeeks.org/determinant-of-a-matrix/\n\n**QUESTION** : Given a square matrix of size N x N. The task is to find the determinant of this matrix.\n\nExpected Time Complexity:  O(N\u003csup\u003e4\u003c/sup\u003e) \u003c/br\u003e\nExpected Auxilliary Space: O(N\u003csup\u003e2\u003c/sup\u003e)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 8 \u003cbr /\u003e\n-10 \u003c= mat[i][j] \u003c= 10\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_18.py)\n\n\n## DAY 19: Transpose of Matrix.\nhttps://www.geeksforgeeks.org/program-to-find-transpose-of-a-matrix/\n\n**QUESTION** : Write a program to find the transpose of a square matrix of size N*/N. \nTranspose of a matrix is obtained by changing rows to columns and columns to rows.\n\nExpected Time Complexity:  O(N*/N) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 100 \u003cbr /\u003e\n-10\u003csup\u003e3\u003c/sup\u003e \u003c= mat[i][j] \u003c= 10\u003csup\u003e3\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_19.py)\n\n\n## DAY 20: Inplace rotate square matrix by 90 degrees.\nhttps://www.geeksforgeeks.org/inplace-rotate-square-matrix-by-90-degrees/\n\n**QUESTION** : Given a square matrix of size N x N. The task is to rotate it by 90 degrees in anti-clockwise \ndirection without using any extra space.\n\nExpected Time Complexity:  O(N\u003csup\u003e2\u003c/sup\u003e) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 ≤ N ≤ 100 \u003cbr /\u003e\n1 \u003c= matrix[][] \u003c= 1000\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_20.py)\n\n\n## DAY 21: Spirally traversing a matrix.\nhttps://www.geeksforgeeks.org/print-a-given-matrix-in-spiral-form/\n\n**QUESTION** : Given a matrix of size R\\*C. Traverse the matrix in spiral form.\n\nExpected Time Complexity:  O(R\\*C) \u003c/br\u003e\nExpected Auxilliary Space: O(R\\*C)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= R, C \u003c= 100   \u003cbr /\u003e\n0 \u003c= matrix\u003csub\u003ei\u003c/sub\u003e \u003c= 100\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_21.py)\n\n\n## DAY 22: Search in a row wise and column wise sorted matrix.\nhttps://www.geeksforgeeks.org/search-in-row-wise-and-column-wise-sorted-matrix/\n\n**QUESTION** : Given a matrix of size n x m, where every row and column is sorted in increasing order, \nand a number x. Find whether element x is present in the matrix or not.\n\nExpected Time Complexity:  O(N + M) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N, M \u003c= 1000  \u003cbr /\u003e\n1 \u003c= mat[][] \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003cbr /\u003e\n1 \u003c= element \u003c= 1000\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_22.py)\n\n\n## DAY 23: Max rectangle.\nhttps://www.geeksforgeeks.org/maximum-size-rectangle-binary-sub-matrix-1s/\n\n**QUESTION** : Given a binary matrix. Find the maximum area of a rectangle formed only of 1s in the given matrix.\n\nExpected Time Complexity:  O(N \\* M) \u003c/br\u003e\nExpected Auxilliary Space: O(M)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= n,m \u003c= 1000   \u003cbr /\u003e\n0 \u003c= M[][] \u003c= 1\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_23.py)\n\n\n## DAY 24: Convert to Roman No.\nhttps://www.geeksforgeeks.org/converting-decimal-number-lying-between-1-to-3999-to-roman-numerals/\n\n**QUESTION** : Given an integer n, your task is to complete the function convertToRoman which prints the \ncorresponding roman number of n. Various symbols and their values are given below.\n\nI 1  \u003cbr /\u003e\nV 5\u003cbr /\u003e\nX 10\u003cbr /\u003e\nL 50\u003cbr /\u003e\nC 100\u003cbr /\u003e\nD 500\u003cbr /\u003e\nM 1000\u003cbr /\u003e\n\nExpected Time Complexity:  O(log\u003csub\u003e10\u003c/sub\u003eN) \u003c/br\u003e\nExpected Auxilliary Space: O(log\u003csub\u003e10\u003c/sub\u003eN * 10)\n\nConstraints: \u003cbr /\u003e\n1\u003c=n\u003c=3999   \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_24.py)\n\n\n## DAY 25: Maximum occuring character.\nhttps://www.geeksforgeeks.org/maximum-occurring-character-in-an-input-string-set-2/\n\n**QUESTION** : Given a string str. The task is to find the maximum occurring character in the string str. \nIf more than one character occurs the maximum number of time then print the lexicographically smaller character.\n\nExpected Time Complexity:  O(N) \u003c/br\u003e\nExpected Auxilliary Space: O(Number of distinct characters)\n\nConstraints: \u003cbr /\u003e\n1 ≤ |s| ≤ 100   \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_25.py)\n\n\n## DAY 26: Missing Characters in Panagram.\nhttps://www.geeksforgeeks.org/missing-characters-make-string-pangram/\n\n**QUESTION** : You are given a string s. You need to find the missing characters in the string to make a panagram.\nNote: The output characters will be lowercase and lexicographically sorted, returns -1 if the string is a panagram, \nelse it returns a string that consists missing characters.\n\nExpected Time Complexity:  O(|S|) \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 ≤ |s| ≤ 10000   \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_26.py\n\n\n## DAY 27: Validate an IP Address.\nhttps://www.geeksforgeeks.org/program-to-validate-an-ip-address/\n\n**QUESTION** : Write a program to Validate an IPv4 Address. According to Wikipedia, IPv4 addresses are \ncanonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging \nfrom 0 to 255, separated by dots, e.g., 172.16.254.1 . The generalized form of an IPv4 address \nis (0-255).(0-255).(0-255).(0-255). Here we are considering numbers only from 0 to 255 and any additional \nleading zeroes will be considered invalid.\n\nYour task is  to complete the function isValid which returns 1 if the ip address is valid else returns 0. \nThe function takes a string s as its only argument .\n\nExpected Time Complexity: O(N), N = length of string. \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1\u003c= length of string \u003c=50 \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_27.py)\n\n\n## DAY 28: Implement strstr.\nhttps://www.geeksforgeeks.org/check-string-substring-another/\n\n**QUESTION** : Your task is to implement the function strstr. The function takes two strings as arguments (s,x) \nand  locates the occurrence of the string x in the string s. The function returns and integer denoting the \nfirst occurrence of the string x in s (0 based indexing).\n\nExpected Time Complexity: O(|s|\\*|x|). \u003c/br\u003e\nExpected Auxilliary Space: O(1)\n\nConstraints: \u003cbr /\u003e\n1 \u003c= |s|,|x| \u003c= 1000\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_28.py)\n\n\n## DAY 29: Isomorphic Strings.\nhttps://www.geeksforgeeks.org/check-if-two-given-strings-are-isomorphic-to-each-other/\n\n**QUESTION** : Given two strings 'str1' and 'str2', check if these two strings are isomorphic to each other.\nTwo strings str1 and str2 are called isomorphic if there is a one to one mapping possible for every character \nof str1 to every character of str2 while preserving the order.\n\nNote: All occurrences of every character in ‘str1’ should map to the same character in ‘str2’.\n\nExpected Time Complexity: O(|str1|+|str2|). \u003c/br\u003e\nExpected Auxilliary Space: O(Number of different characters).\u003c/br\u003e\nNote: |s| represents the length of string s.\n\nConstraints: \u003cbr /\u003e\n1 \u003c= |str1|, |str2| \u003c= 10\u003csup\u003e3\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_29.py)\n\n\n## DAY 30: Check if strings are rotations of each other or not.\nhttps://www.geeksforgeeks.org/check-if-two-given-strings-are-isomorphic-to-each-other/\n\n**QUESTION** : Given two strings s1 and s2. The task is to check if s2 is a rotated version of the string s1. The characters in the strings are in lowercase.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxilliary Space: O(N).\n\nConstraints: \u003cbr /\u003e\n1 \u003c= |str1|, |str2| \u003c= 10\u003csup\u003e7\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_30.py)\n\n\n## DAY 31: Longest Substring Without Repeating Characters.\nhttps://www.geeksforgeeks.org/length-of-the-longest-substring-without-repeating-characters/\n\n**QUESTION** : Given a string S, find the length of its longest substring that does not have any repeating characters.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxilliary Space: O(1).\n\nConstraints: \u003cbr /\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003cbr /\u003e\nhere, N = S.length\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_31.py)\n\n\n\n## DAY 32: Multiply two strings.\nhttps://www.geeksforgeeks.org/multiply-large-numbers-represented-as-strings/\n\n**QUESTION** : Given two numbers as stings s1 and s2. Calculate their Product.\n\nExpected Time Complexity:O(n1 /* n2). \u003c/br\u003e\nExpected Auxilliary Space: O(n1 + n2).\u003c/br\u003e\nwhere n1 and n2 are sizes of strings s1 and s2 respectively.\n\nConstraints: \u003cbr /\u003e\n1 \u003c= length of s1 and s2 \u003c= 10\u003csup\u003e3\u003c/sup\u003e  \u003cbr /\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_32.py)\n\n\n## DAY 33: Anagram.\nhttps://www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/\n\n**QUESTION** : Given two strings a and b consisting of lowercase characters. The task is to check whether two \ngiven strings are an anagram of each other or not. An anagram of a string is another string that contains the \nsame characters, only the order of characters can be different. For example, “act” and “tac” are an anagram of \neach other.\n\nExpected Time Complexity: O(|a|+|b|). \u003c/br\u003e\nExpected Auxiliary Space: O(Number of distinct characters).\u003c/br\u003e\n\nNote: |s| represents the length of string s.\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 ≤ |a|,|b| ≤ 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_33.py)\n\n\n## DAY 34:  Excel Sheet | Part 1.\nhttps://www.geeksforgeeks.org/find-excel-column-name-given-number/\n\n**QUESTION** : Given a positive integer N, return its corresponding column title as it would appear in an Excel sheet.\nFor N =1 we have column A, for 27 we have AA and so on.\u003c/br\u003e\n\nNote: The alphabets are all in uppercase.\n\nExpected Time Complexity: O(Log(N)). \u003c/br\u003e\nExpected Auxiliary Space: O(Log(N)).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e7\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_34.py)\n\n\n## DAY 35: Reverse words in a given string..\nhttps://www.geeksforgeeks.org/reverse-words-in-a-given-string/\n\n**QUESTION** : Given a String S, reverse the string without reversing its individual words. Words are separated by dots.\n\nExpected Time Complexity: O(|S|). \u003c/br\u003e\nExpected Auxiliary Space: O(|S|).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= |S| \u003c= 2000\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_35.py)\n\n\n## DAY 36: Check whether K-th bit is set or not.\nhttps://www.geeksforgeeks.org/check-whether-k-th-bit-set-not/\n\n**QUESTION** : Given a number N and a bit number K, check if Kth bit of N is set or not. A bit is called set if it is 1. Position of set bit '1' should be indexed starting with 0 from LSB side in binary representation of the number.\n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e9\u003c/sup\u003e \u003c/br\u003e\n0 ≤ K ≤ floor(log2(N) + 1) \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_36.py)\n\n\n## DAY 37: Power of 2.\nhttps://www.geeksforgeeks.org/program-to-find-whether-a-no-is-power-of-two/\n\n**QUESTION** : Given a positive integer N. The task is to check if N is a power of 2. More formally, check if N can be expressed as 2x for some x.\n \nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e18\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_37.py)\n\n\n## DAY 38: Number is sparse or not.\nhttps://www.geeksforgeeks.org/check-if-a-given-number-is-sparse-or-not/\n\n**QUESTION** : Given a number N. The task is to check whether it is sparse or not. A number is said to be a \nsparse number if no two or more consecutive bits are set in the binary representation.\n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_38.py)\n\n\n## DAY 39: Bit Difference.\nhttps://www.geeksforgeeks.org/count-number-of-bits-to-be-flipped-to-convert-a-to-b/\n\n**QUESTION** : You are given two numbers A and B. The task is to count the number of bits needed to be \nflipped to convert A to B.\n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_39.py)\n\n\n## DAY 40: Gray to Binary and Gray to Binary equivalent.\nhttps://www.geeksforgeeks.org/gray-to-binary-and-binary-to-gray-conversion/\n\n**QUESTION** : Given N in Gray code equivalent. Find its binary equivalent. \n\nNote: We need to find the binary equivalent of the given gray code and return the decimal \nequivalent of the binary representation.\n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e8\u003c/sup\u003e\u003c/br\u003e\n\n\n**QUESTION** : You are given a decimal number N. You need to find the gray code of the number N and convert it \ninto decimal.\n\nExpected Time Complexity: O(1). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e9\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_40.py)\n\n\n## DAY 41: Find first set bit.\nhttps://www.geeksforgeeks.org/position-of-rightmost-set-bit/\n\n**QUESTION** : Given an integer an N. The task is to return the position of first set bit found from the right \nside in the binary representation of the number.\n\nNote: If there is no set bit in the integer N, then return 0 from the function.  \n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e8\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_41.py)\n\n\n## DAY 42: Count total set bits in all numbers from 1 to n.\nhttps://www.geeksforgeeks.org/count-total-set-bits-in-all-numbers-from-1-to-n/\n\n**QUESTION** : You are given a number N. Find the total count of set bits for all numbers from 1 to N(both inclusive).\n\nExpected Time Complexity: O(LogN). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e8\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_42.py)\n\n\n## DAY 43: Count total set bits in all numbers from 1 to n.\nhttps://www.geeksforgeeks.org/position-rightmost-different-bit/\n\n**QUESTION** : Given two numbers M and N. The task is to find the position of the rightmost different bit \nin the binary representation of numbers. \n\nExpected Time Complexity: O(max(log m, log n)). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= M \u003c= 10\u003csup\u003e9\u003c/sup\u003e\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e9\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_43.py)\n\n\n## DAY 44: Maximum subset XOR.\nhttps://www.geeksforgeeks.org/find-maximum-subset-xor-given-set/\n\n**QUESTION** : You don't need to read input or print anything. Your task is to complete the function\nmaxSubarrayXOR() which takes the array and an integer as input and returns the maximum subset XOR value.\n\nExpected Time Complexity: O(N\\*Log(max(arr[i]))). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n0 \u003c= arr[i] \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_44.py)\n\n\n## DAY 45: Swap all odd and even bits.\nhttps://www.geeksforgeeks.org/swap-all-odd-and-even-bits/\n\n**QUESTION** : Given an unsigned integer N. The task is to swap all odd bits with even bits. \nFor example, if the given number is 23 (00010111), it should be converted to 43(00101011). \nHere, every even position bit is swapped with adjacent bit on the right side(even position \nbits are highlighted in the binary representation of 23), and every odd position bit is \nswapped with an adjacent on the left side.\n\nExpected Time Complexity: O(1). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e9\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_45.py)\n\n\n\n## DAY 46: Check if two arrays are equal or not.\nhttps://www.geeksforgeeks.org/check-if-two-arrays-are-equal-or-not/\n\n**QUESTION** : Given two arrays A and B of equal size N, the task is to find if given arrays are equal or not. \nTwo arrays are said to be equal if both of them contain same set of elements, arrangements (or permutation) \nof elements may be different though.\nNote : If there are repetitions, then counts of repeated elements must also be same for two array to be equal.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e7\u003c/sup\u003e\u003c/br\u003e\n0 \u003c= A[],B[] \u003c= 10\u003csup\u003e18\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_46.py)\n\n\n\n## DAY 47: Max distance between same elements.\nhttps://www.geeksforgeeks.org/maximum-distance-two-occurrences-element-array/\n\n**QUESTION** : Given an array with repeated elements, the task is to find the maximum \ndistance between two occurrences of an element.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_47.py)\n\n\n## DAY 48: Two Sum.\nhttps://www.geeksforgeeks.org/given-an-array-a-and-a-number-x-check-for-pair-in-a-with-sum-as-x/\n\n**QUESTION** : Given an array of positive integers and an integer. Determine whether or \nnot there exist two elements in A whose sum is exactly equal to that integer.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n1 ≤ A[i] ≤ 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n1 ≤ X ≤ 2\\*10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_48.py)\n\n\n## DAY 49: Sorting Elements of an Array by Frequency.\nhttps://www.geeksforgeeks.org/sort-elements-by-frequency/\n\n**QUESTION** : Given an array of integers, sort the array according to frequency of elements. \nThat is elements that have higher frequency come first. If frequencies of two elements are same, \nthen smaller number comes first.\n\nExpected Time Complexity: O(N Log N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n1 ≤ A\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e5\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_49.py)\n\n\n\n## DAY 50: Print Non-Repeated Elements.\nhttps://www.geeksforgeeks.org/non-repeating-element/\n\n**QUESTION** : Hashing is very useful to keep track of the frequency of the elements in a list.\n\nYou are given an array of integers. You need to print the non-repeated elements as they appear \nin the array.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e3\u003c/sup\u003e\u003c/br\u003e\n1 ≤ Arr\u003csub\u003ei\u003c/sub\u003e ≤ 10\u003csup\u003e7\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_50.py)\n\n\n## DAY 51: Largest subarray with 0 sum.\nhttps://www.geeksforgeeks.org/print-all-subarrays-with-0-sum/\n\n**QUESTION** : Given an array having both positive and negative integers. \nThe task is to compute the length of the largest subarray with sum 0.\n\nExpected Time Complexity: O(N\\*Log(N)). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e4\u003c/sup\u003e\u003c/br\u003e\n-1000 \u003c= A[i] \u003c= 1000, for each valid i\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_51.py)\n\n\n## DAY 52: Top K Frequent Elements in Array - | .\nhttps://www.geeksforgeeks.org/find-k-numbers-occurrences-given-array/\n\n**QUESTION** : Given a non-empty array of integers, find the top k elements which have the highest \nfrequency in the array. If two numbers have the same frequency then the larger number should be \ngiven preference.\n\nExpected Time Complexity: O(N\\*Log(N)). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e3\u003c/sup\u003e\u003c/br\u003e\n1 \u003c= A[i] \u003c= 10\u003csup\u003e4\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_52.py)\n\n\n## DAY 53: Sort an array according to the other.\nhttps://www.geeksforgeeks.org/sort-array-according-order-defined-another-array/\n\n**QUESTION** : Given two integer arrays A1[ ] and A2[ ] of size N and M respectively. Sort the \nfirst array A1[ ] such that all the relative positions of the elements in the first array are \nthe same as the elements in the second array A2[ ].\u003c/br\u003e\n\nNote: If elements are repeated in the second array, consider their first occurance only. \u003c/br\u003e\n\nExpected Time Complexity: O(N\\*Log(N)). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N, M \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n1 \u003c= A1[i], A2[i] \u003c= 10\u003csup\u003e6\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_53.py)\n\n\n## DAY 54: Zero Sum Subarrays.\nhttps://www.geeksforgeeks.org/find-the-largest-subarray-with-0-sum/\n\n**QUESTION** : You are given an array arr[] of size n. Find the total count of sub-arrays \nhaving their sum equal to 0.\u003c/br\u003e\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n0 \u003c= N \u003c= 10\u003csup\u003e7\u003c/sup\u003e\u003c/br\u003e\n10\u003csup\u003e-10\u003c/sup\u003e \u003c= arr[i] \u003c= 10\u003csup\u003e10\u003c/sup\u003e\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_54.py)\n\n\n\n## DAY 55: Find All Four Sum Numbers.\nhttps://www.geeksforgeeks.org/find-four-elements-that-sum-to-a-given-value-set-2/\n\n**QUESTION** : Given an array of integers and another number. Find all the unique \nquadruple from the given array that sums up to the given number.\n\nExpected Time Complexity: O(N\u003csup\u003e3\u003c/sup\u003e). \u003c/br\u003e\nExpected Auxiliary Space: O(N\u003csup\u003e2\u003c/sup\u003e).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= N \u003c= 100\u003c/br\u003e\n-1000 \u003c= K \u003c= 1000\u003c/br\u003e\n-100 \u003c= A[] \u003c= 100\u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_55.py)\n\n\n## DAY 56: Count distinct elements in every window.\nhttps://www.geeksforgeeks.org/count-distinct-elements-in-every-window-of-size-k/\n\n**QUESTION** : Given an array of integers and a number K. Find the count of distinct \nelements in every window of size K in the array.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= N \u003c= K \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n1 \u003c= A[i] \u003c= 10\u003csup\u003e5\u003c/sup\u003e , for each valid i \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_56.py)\n\n\n\n## DAY 57: Print elememts of a Linkedlist.\n\n**QUESTION** : Print all elements of a Linked List where we take linked list as input and print the \nlinked list in a single line.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= N \u003c= 100  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_57.py)\n\n\n## DAY 58: Reverse a linked list.\nhttps://www.geeksforgeeks.org/reverse-a-linked-list/\n\n**QUESTION** : Given a linked list of N nodes. The task is to reverse this list.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= N \u003c= 100  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_58.py)\n\n\n\n## DAY 59: Occurence of an integer in a Linked List.\nhttps://www.geeksforgeeks.org/write-a-function-that-counts-the-number-of-times-a-given-int-occurs-in-a-linked-list/\n\n**QUESTION** : Given a singly linked list and a key, count the number of occurrences of given key in the linked list.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(1).\u003c/br\u003e\n\nConstraints:\u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e4\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_59.cpp)\n\n\n## DAY 60: Pairwise swapping\nhttps://www.geeksforgeeks.org/pairwise-swap-elements-of-a-given-linked-list/\n\n**QUESTION** : Given a singly linked list of size N. The task is to swap elements in the linked list pairwise.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e3\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_60.cpp)\n\n\n## DAY 61: Add two numbers represented by linked lists.\nhttps://www.geeksforgeeks.org/sum-of-two-linked-lists/\n\n**QUESTION** : Given two numbers represented by two linked lists of size N and M. The task is \nto return a sum list. The sum list is a linked list representation of the addition of two \ninput numbers.\n\nExpected Time Complexity: O(N+M)\u003c/br\u003e\nExpected Auxiliary Space: O(Max(N,M))\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N, M \u003c= 5000  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_61.cpp)\n\n\n## DAY 62: Sorted insert for circular linked list.\nhttps://www.geeksforgeeks.org/sorted-insert-for-circular-linked-list/\n\n**QUESTION** : Given a sorted circular linked list, the task is to insert a new node in this circular \nlist so that it remains a sorted circular linked list.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_62.cpp)\n\n\n## DAY 63: Split a Circular Linked List into two halves.\nhttps://www.geeksforgeeks.org/split-a-circular-linked-list-into-two-halves/\n\n**QUESTION** : Given a Cirular Linked List of size N, split it into two halves circular lists. \nIf there are odd number of nodes in the given circular linked list then out of the resulting \ntwo halved lists, first list should have one node more than the second list. The resultant \nlists should also be circular lists and not linear lists.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e2\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_63.cpp)\n\n\n## DAY 64: Reverse a Linked List in groups of given size. \nhttps://www.geeksforgeeks.org/reverse-a-list-in-groups-of-given-size/\n\n**QUESTION** : Given a linked list of size N. The task is to reverse every k \nnodes (where k is an input to the function) in the linked list.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e2\u003c/sup\u003e  \u003c/br\u003e\n1 \u003c= k \u003c= N  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_64.cpp)\n\n\n\n## DAY 65: Detect Loop in linked list. \nhttps://www.geeksforgeeks.org/detect-loop-in-a-linked-list/\n\n**QUESTION** : Given a linked list of N nodes. The task is to check if the linked list has \na loop. Linked list can contain self loop.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e4\u003c/sup\u003e  \u003c/br\u003e\n1 \u003c= Data on Node \u003c= 10\u003csup\u003e3\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_65.cpp)\n\n\n## DAY 66: Intersection Point in Y Shapped Linked Lists.\nhttps://www.geeksforgeeks.org/write-a-function-to-get-the-intersection-point-of-two-linked-lists/\n\n**QUESTION** : Given two singly linked lists of size N and M, write a program to get the point where \ntwo linked lists intersect each other.\n\nExpected Time Complexity: O(N+M)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 ≤ N + M ≤ 2\\*10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n-1000 ≤ value ≤ 1000 \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_66.cpp)\n\n\n## DAY 67: Delete Middle of Linked List.\nhttps://www.geeksforgeeks.org/delete-middle-of-linked-list/\n\n**QUESTION** : Given a singly linked list, delete middle of the linked list. For example, \nif given linked list is 1-\u003e2-\u003e3-\u003e4-\u003e5 then linked list should be modified to 1-\u003e2-\u003e4-\u003e5.\n\nIf there are even nodes, then there would be two middle nodes, we need to delete the \nsecond middle element. For example, if given linked list is 1-\u003e2-\u003e3-\u003e4-\u003e5-\u003e6 then it \nshould be modified to 1-\u003e2-\u003e3-\u003e5-\u003e6.\n\nIf the input linked list is NULL or has 1 node, then it should return NULL.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 1000\n1 \u003c= value \u003c= 1000\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_67.cpp)\n\n\n## DAY 68: Clone a linked list with next and random pointer.\nhttps://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/\n\n**QUESTION** : You are given a special linked list with N nodes where each node has a next pointer pointing to its next node. You are also given M random pointers , where you will be given M number of pairs denoting two nodes a and b  i.e. a-\u003earb = b.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 100\n1 \u003c= M \u003c= N\n1 \u003c= a, b \u003c= 100\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_68.cpp)\n\n\n## DAY 69: Quick Sort on Linked List.\nhttps://www.geeksforgeeks.org/quicksort-on-singly-linked-list/\n\n**QUESTION** : Sort the given Linked List using quicksort. which takes O(n^2) time in worst case \nand O(nLogn) in average and best cases, otherwise you may get TLE.\n\nConstraints:  \u003c/br\u003e\n1\u003c=T\u003c=100\n1\u003c=N\u003c=200\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_69.cpp)\n\n\n## DAY 70: Circular Linked List Delete at Position.\nhttps://www.geeksforgeeks.org/delete-middle-of-linked-list/\n\n**QUESTION** : Given a linked list of size n, you have to delete the node at position pos \nof the linked list and return the new head. The position of initial node is 1.\nThe tail of the circular linked list is connected to the head using next pointer.\n\nExpected Time Complexity: O(N)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n2 \u003c= number of nodes \u003c= 10\u003csup\u003e3\u003c/sup\u003e\n1 \u003c= pos \u003c= n\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_70.cpp)\n\n\n## Day 71: QuickSort on Doubly Linked List.\nhttps://www.geeksforgeeks.org/quicksort-for-linked-list/\n\n**QUESTION** : Sort the given doubly linked list of size N using quicksort. Just \ncomplete the partition function using the quicksort technique.\n\nExpected Time Complexity: O(NlogN)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 200\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_71.cpp)\n\n\n## Day 72: Delete without head pointer.\nhttps://www.geeksforgeeks.org/delete-a-node-from-linked-list-without-head-pointer/\n\n**QUESTION** : You are given a pointer/ reference to the node which is to be deleted from the linked list \nof N nodes. The task is to delete the node. Pointer/ reference to head node is not given. \n\nNote: No head reference is given to you. It is guaranteed that the node to be deleted is not a tail \nnode in the linked list.\n\nExpected Time Complexity: O(1)\u003c/br\u003e\nExpected Auxiliary Space: O(1)\n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e3\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_72.cpp)\n\n\n## Day 73: Merge Sort for Doubly Linked List.\nhttps://www.geeksforgeeks.org/merge-sort-for-doubly-linked-list/\n\n**QUESTION** : Given Pointer/Reference to the head of a doubly linked list of N nodes, \nthe task is to Sort the given doubly linked list using Merge Sort in both non-decreasing \nand non-increasing order. \n\nConstraints:  \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_73.cpp)\n\n\n## Day 74: Reverse a string using Stack.\nhttps://www.geeksforgeeks.org/stack-set-3-reverse-string-using-stack/\n\n**QUESTION** : You are given a string S, the task is to reverse the string using stack. \n\nExpected Time Complexity: O(N)\nExpected Auxiliary Space: O(N)\n\nConstraints: \u003c/br\u003e\n1 ≤ length of the string ≤ 100 \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_74.cpp)\n\n\n## Day 75: Next Greater Element.\nhttps://www.geeksforgeeks.org/next-greater-element-in-same-order-as-input/\n\n**QUESTION** : Given an array arr[ ] of size N having distinct elements, the task is to find the next \ngreater element for each element of the array in order of their appearance in the array.\nNext greater element of an element in the array is the nearest element on the right which is greater \nthan the current element.\nIf there does not exist next greater of current element, then next greater element for current element \nis -1. For example, next greater of the last element is always -1.\n\nExpected Time Complexity: O(N)\nExpected Auxiliary Space: O(N)\n\nConstraints: \u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e6\u003c/sup\u003e \u003c/br\u003e\n1 ≤ Ai ≤ 10\u003csup\u003e18\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_75.cpp)\n\n\n## Day 76: Get minimum element from stack.\nhttps://www.geeksforgeeks.org/design-a-stack-that-supports-getmin-in-o1-time-and-o1-extra-space/\n\n**QUESTION** : You are given N elements and your task is to Implement a Stack in which \nyou can get minimum element in O(1) time.\n\nExpected Time Complexity : O(1) for all the 3 methods.\nExpected Auixilliary Space : O(1) for all the 3 methods.\n\nConstraints: \u003c/br\u003e\n1 \u003c= Number of queries \u003c= 100   \u003c/br\u003e\n1 \u003c= values of the stack \u003c= 100  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_76.cpp)\n\n\n## Day 77: Evaluation of Postfix Expression.\nhttps://www.geeksforgeeks.org/stack-set-4-evaluation-postfix-expression/#:~:text=The%20expressions%20written%20in%20postfix,are%20not%20required%20in%20postfix.\u0026text=Following%20is%20algorithm%20for%20evaluation,following%20for%20every%20scanned%20element\n\n**QUESTION** : Given string S representing a postfix expression, the task is to evaluate the \nexpression and find the final value. Operators will only include the basic arithmetic operators \nlike \\*, /, + and -.\n\nExpected Time Complexity : O(|S|)\nExpected Auixilliary Space : O(|S|)\n\nConstraints: \u003c/br\u003e\n1 ≤ |S| ≤ 10\u003csup\u003e5\u003c/sup\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_77.cpp)\n\n\n## Day 78: Max Rectangle\nhttps://www.geeksforgeeks.org/maximum-size-rectangle-binary-sub-matrix-1s/\n\n**QUESTION** : Given a binary matrix. Find the maximum area of a rectangle formed only of 1s in the given matrix.\n\nExpected Time Complexity : O(R\\*C)\nExpected Auixilliary Space : O(C)\n\nConstraints: \u003c/br\u003e\n1 \u003c= n,m \u003c= 1000\n0 \u003c= M[][] \u003c= 1\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_78.cpp)\n\n\n## Day 79: Sort a stack.\nhttps://www.geeksforgeeks.org/sort-a-stack-using-recursion/\n\n**QUESTION** : Given a stack, the task is to sort it such that the top of the stack has the greatest element.\n\nExpected Time Complexity : O(N\\*N)\nExpected Auixilliary Space : O(N) recursive\n\nConstraints: \u003c/br\u003e\n1\u003c=N\u003c=100\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_79.cpp)\n\n\n## Day 80: Max area histogram\nhttps://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/\n\n**QUESTION** : Find the largest rectangular area possible in a given histogram.\n\nExpected Time Complxity : O(N)  \u003c/br\u003e\nExpected Auxilliary Space : O(N)\n\nConstraints: \u003c/br\u003e\n1 \u003c= N \u003c= 10^6 \u003c/br\u003e\n1 \u003c= arr[i] \u003c= 10^12\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_80.cpp)\n\n\n## Day 81: Max area histogram\nhttps://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/\n\n**QUESTION** : Given an expression string x. Examine whether the pairs and the orders of \n“{“,”}”,”(“,”)”,”[“,”]” are correct in exp.\n\nFor example, the function should return 'true' for \nexp = “[()]{}{[()()]()}” and 'false' for exp = “[(])”.\n\nExpected Time Complxity : O(|x|) \u003c/br\u003e\nExpected Auxilliary Space : O(|x|) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ |x| ≤ 32000  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_81.cpp)\n\n\n## Day 82: Maximum of minimum for every window size.\nhttps://www.geeksforgeeks.org/find-the-maximum-of-minimums-for-every-window-size-in-a-given-array/\n\n**QUESTION** : Given an integer array. The task is to find the maximum of the minimum of every window \nsize in the array.\nNote: Window size varies from 1 to the size of the Array.\n\nExpected Time Complxity : O(N)\u003c/br\u003e\nExpected Auxilliary Space :  O(N) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= N \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n1 \u003c= arr[i] \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_82.cpp)\n\n\n\n## Day 83: Stock span problem.\nhttps://www.geeksforgeeks.org/the-stock-span-problem/\n\n**QUESTION** : The stock span problem is a financial problem where we have a series of n daily price \nquotes for a stock and we need to calculate the span of stock’s price for all n days. \nThe span Si of the stock’s price on a given day i is defined as the maximum number of consecutive \ndays just before the given day, for which the price of the stock on the current day is less than or \nequal to its price on the given day.\nFor example, if an array of 7 days prices is given as {100, 80, 60, 70, 60, 75, 85}, then the span \nvalues for corresponding 7 days are {1, 1, 1, 2, 1, 4, 6}.\n\nExpected Time Complxity : O(N) \u003c/br\u003e\nExpected Auxilliary Space : O(N) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n1 ≤ C[i] ≤ 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_83.cpp)\n\n\n## Day 84: Infix to Postfix.\nhttps://www.geeksforgeeks.org/stack-set-2-infix-to-postfix/\n\n**QUESTION** : Given an infix expression in the form of string str. Convert this infix expression to \npostfix expression.\nInfix expression: The expression of the form a op b. When an operator is in-between every pair of operands.\nPostfix expression: The expression of the form a b op. When an operator is followed for every pair of operands.\nNote: The order of precedence is: ^ greater than * equals to / greater than + equals to -. \n\n\nExpected Time Complxity : O(|str|) \u003c/br\u003e\nExpected Auxilliary Space : O(|str|) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ |str| ≤ 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_84.cpp)\n\n\n## Day 85: Generate Binary Numbers.\nhttps://www.geeksforgeeks.org/interesting-method-generate-binary-numbers-1-n/\n\n**QUESTION** : Given a number N. The task is to generate and print all binary numbers with \ndecimal values from 1 to N.\n\nExpected Time Complxity : O(N log2N) \u003c/br\u003e\nExpected Auxilliary Space : O(N log2N) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e6\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_85.cpp)\n\n\n## Day 86: Queue Push \u0026 Pop.\n\n**QUESTION** : Given an array arr[] of size N, enqueue the elements of the array into a queue \nand then dequeue them.\n\nExpected Time Complxity : O(N) \u003c/br\u003e\nExpected Auxilliary Space : O(N) \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= A\u003csub\u003ei\u003c/sub\u003e \u003c= 10\u003csup\u003e6\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_86.cpp)\n\n\n\n## Day 87: Queue Push \u0026 Pop.\nhttps://www.geeksforgeeks.org/implement-stack-using-queue/\n\n**QUESTION** : Implement a Stack using two queues q1 and q2.\n\nExpected Time Complxity :  O(1) for push() and O(N) for pop()  \u003c/br\u003e\nExpected Auxilliary Space :  O(1) for push() and O(N) for pop()  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= Number of queries \u003c= 100   \u003c/br\u003e\n1 \u003c= values of the stack \u003c= 100   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_87.cpp)\n\n\n## Day 88: Queue using circular array.\n\n**QUESTION** : Given size of a queue and Q query. The task is to perform operations according to the \ntype of query. Queries can be of following types:\n    1) 1 element: This means push the element into the queue (allowed only when queue is not full).\n    2) 2: This means pop the element at front from the queue (allowed only when queue is not empty).\n\nConstraints: \u003c/br\u003e\n1 \u003c= size \u003c= 10\u003csup\u003e4\u003c/sup\u003e \u003c/br\u003e\n1 \u003c= Q \u003c= 10\u003csup\u003e3\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_88.cpp)\n\n\n## DAY 89: Reverse First K elements of Queue.\nhttps://www.geeksforgeeks.org/reversing-first-k-elements-queue/\n\n**QUESTION** : Given an integer K and a queue of integers, we need to reverse the order of the first K \nelements of the queue, leaving the other elements in the same relative order. \u003c/br\u003e\n\nOnly following standard operations are allowed on queue. \u003c/br\u003e\n    enqueue(x) : Add an item x to rear of queue \u003c/br\u003e\n    dequeue() : Remove an item from front of queue \u003c/br\u003e\n    size() : Returns number of elements in queue. \u003c/br\u003e\n    front() : Finds front item. \u003c/br\u003e\n\nExpected TIme Complexity : O(n) \u003c/br\u003e\nExpected Auxilliary Space : O(n)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= N \u003c= 1000 \u003c/br\u003e\n1 \u003c= K \u003c= N \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_89.cpp)\n\n\n## DAY 90: Queue using two Stacks.\nhttps://www.geeksforgeeks.org/queue-using-stacks/\n\n**QUESTION** : Implement a Queue using 2 stacks s1 and s2 . \u003c/br\u003e\nA Query Q is of 2 Types  \u003c/br\u003e\n(i) 1 x (a query of this type means  pushing 'x' into the queue)  \u003c/br\u003e\n(ii) 2   (a query of this type means to pop element from queue and print the poped element)  \u003c/br\u003e\n\nExpected TIme Complexity : O(1) for push() and O(N) for pop() or O(N) for push() and \nO(1) for pop() \u003c/br\u003e\nExpected Auxilliary Space : O(1)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= Q \u003c= 100 \u003c/br\u003e\n1 \u003c= x \u003c= 100 \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_90.cpp)\n\n\n\n## DAY 91: Maximum of all subarrays of size k.\nhttps://www.geeksforgeeks.org/sliding-window-maximum-maximum-of-all-subarrays-of-size-k/\n\n**QUESTION** : Given an array arr[] of size N and an integer K. Find the maximum for each and \nevery contiguous subarray of size K.\n\nExpected TIme Complexity : O(N) \u003c/br\u003e\nExpected Auxilliary Space : O(N)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e7\u003c/sup\u003e  \u003c/br\u003e\n1 ≤ K ≤ N \u003c/br\u003e\n0 ≤ arr[i] \u003c= 10\u003csup\u003e7\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_91.cpp)\n\n\n\n## DAY 92: Minimum steps to reach target by a Knight.\nhttps://www.geeksforgeeks.org/minimum-steps-reach-target-knight/\n\n**QUESTION** : Given a square chessboard of N x N size, the position of Knight and position of a target is given. \nWe need to find out the minimum steps a Knight will take to reach the target position.\n\nExpected Time Complexity : O(N\u003csup\u003e2\u003c/sup\u003e) \u003c/br\u003e\nExpected Auxilliary Space : O(N\u003csup\u003e2\u003c/sup\u003e)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= N \u003c= 1000  \u003c/br\u003e\n1 \u003c= Knight_pos(X, Y), Targer_pos(X, Y) \u003c= N  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_92.cpp)\n\n\n\n## DAY 93: Index of an extra element present in one sorted array.\nhttps://www.geeksforgeeks.org/find-index-of-an-extra-element-present-in-one-sorted-array/\n\n**QUESTION** : Given two sorted arrays. There is only 1 difference between the arrays. \nThe first array has one element extra added in between. Find the index of the extra element.\n\nExpected Time Complexity : O(log n) \u003c/br\u003e\nExpected Auxilliary Space : O(1)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 ≤ N ≤ 10\u003csup\u003e7\u003c/sup\u003e  \u003c/br\u003e\n0 ≤ arr[i] \u003c= 10\u003csup\u003e7\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_93.cpp)\n\n\n\n## DAY 94: Find perimeter of shapes.\nhttps://www.geeksforgeeks.org/find-perimeter-shapes-formed-1s-binary-matrix/\n\n**QUESTION** : Given a matrix mat[][] of n rows and m columns, consisting of 0’s and 1’s. The \ntask is to complete the function findPerimeter which returns an integer denoting the perimeter \nof sub-figures consisting of only 1’s in the matrix.\n\nExpected Time Complexity : O(n\u003csup\u003e2\u003c/sup\u003e) \u003c/br\u003e\nExpected Auxilliary Space : O(1)  \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n1 \u003c= T \u003c= 100  \u003c/br\u003e\n1 \u003c= n, m \u003c= 20   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_94.cpp)\n\n\n\n## DAY 95: Count pairs from two linked lists whose sum is equal to a given value.\nhttps://www.geeksforgeeks.org/count-pairs-two-linked-lists-whose-sum-equal-given-value/\n\n**QUESTION** : Given two linked lists(can be sorted or unsorted) of size n1 and n2 of \ndistinct elements. Given a value x. The problem is to count all pairs from both lists \nwhose sum is equal to the given value x. \u003c/br\u003e\nNote: The pair has an element from each linked list.  \u003c/br\u003e\n\nExpected Time Complexity : O(n1 + n2) \u003c/br\u003e\nExpected Auxilliary Space : O(1)  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_95.py)\n\n\n\n## DAY 96: Check whether the length of given linked list is Even or Odd.\nhttps://www.geeksforgeeks.org/check-whether-the-length-of-given-linked-list-is-even-or-odd/\n\n**QUESTION** : Given a linked list, task is to make a function which check whether the length of \nlinked list is even or odd.\n\nExpected Time Complexity : O(n) \u003c/br\u003e\nExpected Auxilliary Space : O(1)  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_96.py)\n\n\n\n## DAY 97: Find the character in first string that is present at minimum index in second string.\nhttps://www.geeksforgeeks.org/find-character-first-string-present-minimum-index-second-string/\n\n**QUESTION** : Given a string str and another string patt. Find the character in patt that is present \nat the minimum index in str. If no character of patt is present in str then print ‘No character \npresent’.\n\nExpected Time Complexity : O(max(|str|, |patt|)) \u003c/br\u003e\nExpected Auxilliary Space : O(K) where K \u003c= 26 \u003c/br\u003e\n\nConstraints:  \u003c/br\u003e\n1 ≤ |str|, |patt| ≤ 10\u003csup\u003e4\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_97.py)\n\n\n\n## DAY 98: Count Leaves in Binary Tree.\nhttps://www.geeksforgeeks.org/write-a-c-program-to-get-count-of-leaf-nodes-in-a-binary-tree/\n\n**QUESTION** : Given a Binary Tree of size N , You have to count leaves in it. For example, there are \ntwo leaves in following tree \u003c/br\u003e\n\u003c/br\u003e\n        1 \u003c/br\u003e\n     /      \\\n   10      39 \u003c/br\u003e\n  /\n5 \u003c/br\u003e\n\nConstraints:  \u003c/br\u003e\n1\u003c= N \u003c= 10\u003csup\u003e4\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_98.cpp)\n\n\n\n## Day 99: Right View of Binary Tree.\nhttps://www.geeksforgeeks.org/right-view-binary-tree-using-queue/\n\n**QUESTION** : Given a Binary Tree, find Right view of it. Right view of a Binary Tree is set of nodes \nvisible when tree is viewed from right side.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(Height of the Tree). \u003c/br\u003e\n\nConstraints:   \u003c/br\u003e\n1 \u003c= Number of nodes \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n1 \u003c= Data of a node \u003c= 10\u003csup\u003e5\u003c/sup\u003e   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_99.cpp)\n\n\n\n## Day 100: Two Mirror Trees.\nhttps://www.geeksforgeeks.org/check-if-two-trees-are-mirror/\n\n**QUESTION** : Given a Two Binary Trees, write a function that returns true \nif one is mirror of other, else returns false.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(Height of the Tree). \u003c/br\u003e\n\nConstraints:   \u003c/br\u003e\n1 \u003c= Number of nodes\u003c= 10000  \u003c/br\u003e\n-1000 \u003c= Data of a node\u003c= 1000   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_100.cpp)\n\n\n\n## Day 101:  Diameter of Binary Tree.\nhttps://www.geeksforgeeks.org/diameter-of-a-binary-tree/\n\n**QUESTION** : Given a Binary Tree, find diameter of it.\nThe diameter of a tree is the number of nodes on the longest path \nbetween two end nodes in the tree.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(Height of the Tree). \u003c/br\u003e\n\nConstraints:   \u003c/br\u003e\n1 \u003c= Number of nodes\u003c= 10000  \u003c/br\u003e\n1 \u003c= Data of a node\u003c= 1000   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_101.cpp)\n\n\n\n## Day 102: Sum Tree .\nhttps://www.geeksforgeeks.org/check-if-a-given-binary-tree-is-sumtree/\n\n**QUESTION** : Given a Binary Tree. Check whether it is a Sum Tree or not.\nA Binary Tree is a Sum Tree in which value of each node x is equal to sum \nof nodes present in its left subtree and right subtree . An empty tree is \nalso a Sum Tree as sum of an empty tree can be considered to be 0. A leaf \nnode is also considered as a Sum Tree.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(Height of the Tree). \u003c/br\u003e\n\nConstraints:   \u003c/br\u003e\n1 ≤ number of nodes ≤ 10\u003csup\u003e4\u003c/sup\u003e   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_102.cpp)\n\n\n\n## Day 103: ZigZag Tree Traversal.\nhttps://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/\n\n**QUESTION** : Given a Binary Tree. Find the Zig-Zag Level Order Traversal of \nthe Binary Tree.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N). \u003c/br\u003e\n\nConstraints:   \u003c/br\u003e\n1 ≤ number of nodes ≤ 10\u003csup\u003e4\u003c/sup\u003e   \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_103.cpp)\n\n\n\n## Day 104: Level Order Traversal.\nhttps://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/\n\n**QUESTION** : Complete the function to find spiral order traversal of a tree.\n\nExpected Time Complexity: O(N). \u003c/br\u003e\nExpected Auxiliary Space: O(N). \u003c/br\u003e\n\nConstraints: \u003c/br\u003e\n0 \u003c= Number of nodes \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n0 \u003c= Data of a node \u003c= 10\u003csup\u003e5\u003c/sup\u003e  \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_104.cpp)\n\n\n\n## Day 105\n\n\n\n## Day 106: Determine if Two Trees are Identical .\nhttps://www.geeksforgeeks.org/write-c-code-to-determine-if-two-trees-are-identical/\n\n**QUESTION** : Given two binary trees, the task is to find if both of them are identical or not. \n\nExpected Time Complexity: O(N) \u003c/br\u003e\nExpected Auxiliary Space: O(height of tree)  \u003c/br\u003e\n\nConstraints:\n1 \u003c= Number of nodes \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n1 \u003c= Data of a node \u003c= 10\u003csup\u003e5\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_106.cpp)\n\n\n\n## Day 107: Root to leaf path sum.\nhttps://www.geeksforgeeks.org/root-to-leaf-path-sum-equal-to-a-given-number/\n\n**QUESTION** : Given a binary tree and an integer S, check whether there is root \nto leaf path with its sum as S.\n\nExpected Time Complexity: O(N) \u003c/br\u003e\nExpected Auxiliary Space: O(height of tree)  \u003c/br\u003e\n\nConstraints:\n1 ≤ N ≤ 10\u003csup\u003e4\u003c/sup\u003e \u003c/br\u003e\n1 ≤ S ≤ 10\u003csup\u003e6\u003c/sup\u003e \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_107.cpp)\n\n\n\n## Day 108: Vertical sum.\nhttps://www.geeksforgeeks.org/vertical-sum-in-a-given-binary-tree/\n\n**QUESTION** : Given a Binary Tree, find vertical sum of the nodes that are in same vertical line. \nPrint all sums through different vertical lines starting from left-most vertical line to \nright-most vertical line.\n\nExpected Time Complexity: O(N) \u003c/br\u003e\nExpected Auxiliary Space: O(N)  \u003c/br\u003e\n\nConstraints:\n1 \u003c= Number of nodes \u003c= 1000 \u003c/br\u003e\n\nMy Solution [here](https://github.com/iamakkkhil/DailyCoding/blob/master/Day_108.cpp)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamakkkhil%2Fdailycoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamakkkhil%2Fdailycoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamakkkhil%2Fdailycoding/lists"}