|
6 | 6 |
|
7 | 7 | | Current Status| Stats | |
8 | 8 | | :------------: | :----------: | |
9 | | -| Total Problems | 123 | |
10 | | -| Current Streak | 85 days | |
11 | | -| Longest Streak | 85 ( August 17, 2015 - November 09, 2015 ) | |
| 9 | +| Total Problems | 125 | |
| 10 | +| Current Streak | 86 days | |
| 11 | +| Longest Streak | 86 ( August 17, 2015 - November 10, 2015 ) | |
12 | 12 |
|
13 | 13 | </center> |
14 | 14 |
|
15 | | -### LinkedList Problems |
| 15 | +### LinkedList Problems |
16 | 16 | | Problem | Solution | |
17 | 17 | | :------------ | :----------: | |
18 | 18 | | Find the nth node of linked list from last. | [nthToLastNode.cpp] (linked_list_problems/nthToLastNode.cpp) | |
|
32 | 32 | | Sort a linked list using merge sort | [merge_sort.cpp] (linked_list_problems/merge_sort.cpp) | |
33 | 33 | | Given a singly linked list L<sub>0</sub> -> L<sub>1</sub> -> … -> L<sub>n-1</sub> -> L<sub>n</sub>. Rearrange the nodes in the list (in place) so that the new formed list is : L<sub>0</sub> -> L<sub>n</sub> -> L<sub>1</sub> -> L<sub>n-1</sub> -> L<sub>2</sub> -> L<sub>n-2<sub> ....| [rearrange_list.cpp](linked_list_problems/rearrange_list.cpp)| |
34 | 34 |
|
35 | | -### Include |
| 35 | +### Include |
36 | 36 | Include contains single header implementation of data structures and some algorithms. |
37 | 37 |
|
38 | 38 | | DS/ALG | Implementation | |
@@ -159,6 +159,7 @@ Include contains single header implementation of data structures and some algori |
159 | 159 | | Find the maximum element in an array which is first increasing and then decreasing. Input: arr[] = {8, 10, 20, 80, 100, 200, 400, 500, 3, 2, 1}, output : 500. Array may be strictly increasing or decreasing as well. ExpectedTime complexity is O(logn).| [findMaximum.cpp](sort_search_problems/findMaximum.cpp)| |
160 | 160 | | Given an array of positive and/or negative integers, find a pair in the array whose sum is closest to 0.| [findClosestPairToZero.cpp](sort_search_problems/findClosestPairToZero.cpp)| |
161 | 161 | | Numeros, the Artist, had two lists A and B, such that B was a permutation of A. Numeros was very proud of these lists. Unfortunately, while transporting them from one exhibition to another, some numbers were left out of A. Can you find the missing numbers? Notes: <ul><li>If a number occurs multiple times in the lists, you must ensure that the frequency of that number in both lists is the same. If that is not the case, then it is also a missing number.</li></ul><ul><li>You have to print all the missing numbers in ascending order.</li></ul><ul><li>Print each missing number once, even if it is missing multiple times.</li></ul><ul><li>The difference between maximum and minimum number in B is less than or equal to 100.</li></ul>. <ul><li> There will be four lines of input: n - the size of the first list, This is followed by n space-separated integers that make up the first list. m - the size of the second list. This is followed by m space-separated integers that make up the second list. Output the missing numbers in ascending order.| [missingNumbers.cpp](leet_code_problems/missingNumbers.cpp)| |
| 162 | +| Find the closest pair from two sorted arrays. Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each array. We are given two arrays ar1[0…m-1] and ar2[0..n-1] and a number x, we need to find the pair ar1[i] + ar2[j] such that absolute value of (ar1[i] + ar2[j] – x) is minimum.| [closestPairSorted.cpp](sort_search_problems/closestPairSorted.cpp)| |
162 | 163 | ### Graph Problems |
163 | 164 | | Problem | Solution | |
164 | 165 | | :------------ | :----------: | |
@@ -199,6 +200,8 @@ Include contains single header implementation of data structures and some algori |
199 | 200 | | Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time.| [minPath.cpp](leet_code_problems/minPath.cpp)| |
200 | 201 | | Count the number of prime numbers less than a non-negative number, n.| [countPrimes.cpp](leet_code_problems/countPrimes.cpp)| |
201 | 202 | | Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers. Ensure that numbers within the set are sorted in ascending order. Example : for k = 3, n = 9 result would be [[1,2,6], [1,3,5], [2,3,4]], similarly for k = 3, n = 7, result would be [[1,2,4]]. | [combinationSum3.cpp](leet_code_problems/combinationSum3.cpp) | |
| 203 | +| Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. Follow up: |
| 204 | +Could you do it without any loop/recursion in O(1) runtime?| [sumDigits.cpp](leet_code_problems/sumDigits.cpp)| |
202 | 205 |
|
203 | 206 |
|
204 | 207 |
|
|
0 commit comments