{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":583257513,"defaultBranch":"main","name":"HackerRank","ownerLogin":"Chukwudebelu","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2022-12-29T08:30:42.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/32755252?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1672302834.264108","currentOid":""},"activityList":{"items":[{"before":"19f2319bf0a0dcfd840101a5b7d0c44aee8e73dd","after":"9906c15ef9deeba341e24ff19a2f34d1b2849600","ref":"refs/heads/main","pushedAt":"2024-07-31T21:03:43.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create 2DArrayDS0.py","shortMessageHtmlLink":"Create 2DArrayDS0.py"}},{"before":"fc11464897877327e55bf3b40aec373adb15b28c","after":"19f2319bf0a0dcfd840101a5b7d0c44aee8e73dd","ref":"refs/heads/main","pushedAt":"2024-07-26T11:46:04.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create InsertNodeIntoSortedDoublyLinkedList1.py","shortMessageHtmlLink":"Create InsertNodeIntoSortedDoublyLinkedList1.py"}},{"before":"5711c08fea19fabee61c417f6a13e1964d506a79","after":"fc11464897877327e55bf3b40aec373adb15b28c","ref":"refs/heads/main","pushedAt":"2024-07-26T11:13:31.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create InsertNodeIntoSortedDoublyLinkedList0.py\n\nGiven a reference to the head of a doubly-linked list and an integer, data, create a new DoublyLinkedListNode object having data value data and insert it at the proper location to maintain the sort.\r\n\r\nExample\r\nhead refers to the list 1 ↔ 2 ↔ 4 ↔ NULL\r\ndata = 3\r\nReturn a reference to the new list: 1 ↔ 2 ↔ 3 ↔ 4 → NULL.\r\n\r\nFunction Description\r\nComplete the sortedInsert function in the editor below.\r\nsortedInsert has two parameters:\r\n• DoublyLinkedListNode pointer head: a reference to the head of a doubly-linked list\r\n• int data: An integer denoting the value of the data field for the DoublyLinkedListNode you must insert into the list.\r\n\r\nReturns\r\n• DoublyLinkedListNode pointer: a reference to the head of the list\r\nNote: Recall that an empty list (i.e., where head = NULL) and a list with one element are sorted lists.\r\n\r\nInput Format\r\nThe first line contains an integer t, the number of test cases.\r\nEach of the test case is in the following format:\r\n• The first line contains an integer , the number of elements in the linked list.\r\n• Each of the next lines contains an integer, the data for each node of the linked list.\r\n• The last line contains an integer, , which needs to be inserted into the sorted doubly-linked list.\r\n\r\nConstraints\r\n• 1 t 10\r\n• 1 n 1000\r\n• 1 DoublyLinkedListNode, data 1000\r\n\r\nSample Input\r\n STDIN Function\r\n ----- --------\r\n 1 t = 1\r\n 4 n = 4\r\n 1 node data values = 1, 3, 4, 10\r\n 3\r\n 4\r\n 10\r\n 5 data = 5\r\n\r\nSample Output\r\n 1 3 4 5 10\r\n\r\nExplanation\r\nThe initial doubly linked list is: 1 ↔ 3 ↔ 4 ↔ 10 → NULL\r\nThe doubly linked list after insertion is: 1 ↔ 3 ↔ 4 ↔ 5 ↔ 10 → NULL","shortMessageHtmlLink":"Create InsertNodeIntoSortedDoublyLinkedList0.py"}},{"before":"33c53cbb4d58696286eafa72d9b7b1e383669ceb","after":"5711c08fea19fabee61c417f6a13e1964d506a79","ref":"refs/heads/main","pushedAt":"2024-07-25T12:11:41.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create MergeTwoSortedLinkedLists1.py","shortMessageHtmlLink":"Create MergeTwoSortedLinkedLists1.py"}},{"before":"028353e84afea14763909f2f71c4a4bb9c585599","after":"33c53cbb4d58696286eafa72d9b7b1e383669ceb","ref":"refs/heads/main","pushedAt":"2024-07-25T11:37:13.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Update MergeTwoSortedLinkedLists0.py\n\nGiven pointers to the heads of two sorted linked lists, merge them into a single, sorted linked list. Either head pointer may be null meaning that the corresponding list is empty.\r\n\r\nExample\r\nheadA refers to 1 → 3 → 7 → NULL\r\nheadB refers to 1 → 2 → NULL\r\nThe new list is 1 → 1 → 2 → 3 → 7 → NULL\r\n\r\nFunction Description\r\nComplete the mergeLists function in the editor below.\r\nmergeLists has the following parameters:\r\n• SinglyLinkedListNode pointer headA: a reference to the head of a list\r\n• SinglyLinkedListNode pointer headB: a reference to the head of a list\r\n\r\nReturns\r\n• SinglyLinkedListNode pointer: a reference to the head of the merged list\r\n\r\nInput Format\r\nThe first line contains an integer t, the number of test cases.\r\nThe format for each test case is as follows:\r\nThe first line contains an integer n, the length of the first linked list.\r\nThe next n lines contain an integer each, the elements of the linked list.\r\nThe next line contains an integer m, the length of the second linked list.\r\nThe next m lines contain an integer each, the elements of the second linked list.\r\n\r\nConstraints\r\n• 1 ≤ t ≤ 10\r\n• 1 ≤ n, m ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000, where list[i] is the iᵗʰ element of the list.\r\n\r\nSample Input\r\n 1\r\n 3\r\n 1\r\n 2\r\n 3\r\n 2\r\n 3\r\n 4\r\n\r\nSample Output\r\n 1 2 3 3 4\r\n\r\nExplanation\r\nThe first linked list is: 1 → 2 → 3 → NULL\r\nThe second linked list is: 3 → 4 → NULL\r\nHence, the merged linked list is: 1 → 2 → 3 → 3 → 4 → NULL","shortMessageHtmlLink":"Update MergeTwoSortedLinkedLists0.py"}},{"before":"06b9f6956415f94fae38aadc3649daaeafc046c4","after":"028353e84afea14763909f2f71c4a4bb9c585599","ref":"refs/heads/main","pushedAt":"2024-07-25T11:32:23.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create MergeTwoSortedLinkedLists0.py\n\nGiven pointers to the heads of two sorted linked lists, merge them into a single, sorted linked list. Either head pointer may be null meaning that the corresponding list is empty.\r\n\r\nExample\r\nheadA refers to 1 → 3 → 7 → NULL\r\nheadB refers to 1 → 2 → NULL\r\nThe new list is 1 → 1 → 2 → 3 → 7 → NULL\r\n\r\nFunction Description\r\nComplete the mergeLists function in the editor below.\r\nmergeLists has the following parameters:\r\n• SinglyLinkedListNode pointer headA: a reference to the head of a list\r\n• SinglyLinkedListNode pointer headB: a reference to the head of a list\r\n\r\nReturns\r\n• SinglyLinkedListNode pointer: a reference to the head of the merged list\r\n\r\nInput Format\r\nThe first line contains an integer t, the number of test cases.\r\nThe format for each test case is as follows:\r\nThe first line contains an integer n, the length of the first linked list.\r\nThe next n lines contain an integer each, the elements of the linked list.\r\nThe next line contains an integer m, the length of the second linked list.\r\nThe next m lines contain an integer each, the elements of the second linked list.\r\n\r\nConstraints\r\n• 1 ≤ t ≤ 10\r\n• 1 ≤ n, m ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000, where list[i] is the iᵗʰ element of the list.\r\n\r\nSample Input\r\n 1\r\n 3\r\n 1\r\n 2\r\n 3\r\n 2\r\n 3\r\n 4\r\n\r\nSample Output\r\n 1 2 3 3 4\r\n\r\nExplanation\r\nThe first linked list is: 1 → 2 → 3 → NULL\r\nThe second linked list is: 3 → 4 → NULL\r\nHence, the merged linked list is: 1 → 2 → 3 → 3 → 4 → NULL","shortMessageHtmlLink":"Create MergeTwoSortedLinkedLists0.py"}},{"before":"bf280cfe61f6e8ece0a6faa0e4e2eda5e77cff19","after":"06b9f6956415f94fae38aadc3649daaeafc046c4","ref":"refs/heads/main","pushedAt":"2024-07-24T11:12:12.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create CycleDetection2.py","shortMessageHtmlLink":"Create CycleDetection2.py"}},{"before":"4ccac41afbb327a794c94fb90ccbf942704a5e11","after":"bf280cfe61f6e8ece0a6faa0e4e2eda5e77cff19","ref":"refs/heads/main","pushedAt":"2024-07-24T11:11:00.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create CycleDetection1.py","shortMessageHtmlLink":"Create CycleDetection1.py"}},{"before":"5bd115fd3c583afa632e007938a2c508621e6f9a","after":"4ccac41afbb327a794c94fb90ccbf942704a5e11","ref":"refs/heads/main","pushedAt":"2024-07-24T11:09:12.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create CycleDetection0.py\n\nA linked list is said to contain a cycle if any node is visited more than once while traversing the list. Given a pointer to the head of a linked list, determine if it contains a cycle. If it does, return 1. Otherwise, return 0.\r\n\r\nExample\r\nhead refers to the list of nodes 1 → 2 → 3 → NULL\r\nThe numbers shown are the node numbers, not their data values. There is no cycle in this list so return 0.\r\nhead refers to the list of nodes 1 → 2 → 3 → 1 → NULL\r\nThere is a cycle where node 3 points back to node 1, so return 1.\r\n\r\nFunction Description\r\nComplete the has_cycle function in the editor below.\r\nIt has the following parameter:\r\n• SinglyLinkedListNode pointer head: a reference to the head of the list\r\n\r\nReturns\r\n• int: 1 if there is a cycle or 0 if there is not\r\nNote: If the list is empty, head will be null.\r\n\r\nInput Format\r\nThe code stub reads from stdin and passes the appropriate argument to your function. The custom test cases format will not be described for this question due to its complexity. Expand the section for the main function and review the code if you would like to figure out how to create a custom case.\r\n\r\nConstraints\r\n• 0 ≤ list size ≤ 1000\r\n\r\nSample Input\r\nReferences to each of the following linked lists are passed as arguments to your function:\r\n[https://s3.amazonaws.com/hr-challenge-images/1163/1463778594-900a0ae522-inputs.png]\r\n\r\nSample Output\r\n 0\r\n 1\r\n\r\nExplanation\r\n1. The first list has no cycle, so return 0.\r\n2. The second list has a cycle, so return 1.","shortMessageHtmlLink":"Create CycleDetection0.py"}},{"before":"9d03259b8277be6e32629bebb647ec268b67c90f","after":"5bd115fd3c583afa632e007938a2c508621e6f9a","ref":"refs/heads/main","pushedAt":"2024-07-23T20:20:17.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create DeleteNode1.py","shortMessageHtmlLink":"Create DeleteNode1.py"}},{"before":"4c8ada1b5bf83a00ffbfbee3bb8beca43cce1ba8","after":"9d03259b8277be6e32629bebb647ec268b67c90f","ref":"refs/heads/main","pushedAt":"2024-07-23T20:13:35.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create DeleteNode0.py\n\nDelete the node at a given position in a linked list and return a reference to the head node. The head is at position 0. The list may be empty after you delete the node. In that case, return a null value.\r\n\r\nExample\r\nllist = 0 → 1 → 2 → 3\r\nposition = 2\r\n\r\nAfter removing the node at position 2, llist = 0 → 1 → 3.\r\n\r\nFunction Description\r\nComplete the deleteNode function in the editor below.\r\ndeleteNode has the following parameters:\r\n- SinglyLinkedListNode pointer llist: a reference to the head node in the list\r\n- int position: the position of the node to remove\r\n\r\nReturns\r\n- SinglyLinkedListNode pointer: a reference to the head of the modified list\r\n\r\nInput Format\r\nThe first line of input contains an integer n, the number of elements in the linked list.\r\nEach of the next n lines contains an integer, the node data values in order.\r\nThe last line contains an integer, position, the position of the node to delete.\r\n\r\nConstraints\r\n• 1 ≤ n ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000, where list[i] is the iᵗʰ element of the linked list.\r\n\r\nSample Input\r\n 8\r\n 20\r\n 6\r\n 2\r\n 19\r\n 7\r\n 4\r\n 15\r\n 9\r\n 3\r\n\r\nSample Output\r\n 20 6 2 7 4 15 9\r\n\r\nExplanation\r\nThe original list is 20 → 6 → 2 → 19 → 7 → 4 → 15 → 9. After deleting the node at position 3, the list is 20 → 6 → 2 → 7 → 4 → 15 → 9.","shortMessageHtmlLink":"Create DeleteNode0.py"}},{"before":"9a7c691d497a2fd326b79c58b6d179887bdfb930","after":"4c8ada1b5bf83a00ffbfbee3bb8beca43cce1ba8","ref":"refs/heads/main","pushedAt":"2024-07-22T10:52:27.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create CompareTwoLinkedLists1.py","shortMessageHtmlLink":"Create CompareTwoLinkedLists1.py"}},{"before":"8538b84a9b0ec4e9cfe9960b8f68e4c752bb9403","after":"9a7c691d497a2fd326b79c58b6d179887bdfb930","ref":"refs/heads/main","pushedAt":"2024-07-22T10:50:14.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create CompareTwoLinkedLists0.py\n\nYou’re given the pointer to the head nodes of two linked lists. Compare the data in the nodes of the linked lists to check if they are equal. If all data attributes are equal and the lists are the same length, return 1. Otherwise, return 0.\r\n\r\nExample\r\n llist1 = 1 → 2 → 3 → NULL\r\n llist2 = 1 → 2 → 3 → 4 → NULL\r\n\r\nThe two lists have equal data attributes for the first 3 nodes. llist2 is longer, though, so the lists are not equal. Return 0.\r\n\r\nFunction Description\r\nComplete the compare_lists function in the editor below.\r\ncompare_lists has the following parameters:\r\n• SinglyLinkedListNode llist1: a reference to the head of a list\r\n• SinglyLinkedListNode llist2: a reference to the head of a list\r\n\r\nReturns\r\n• int: return 1 if the lists are equal, or 0 otherwise\r\n\r\nInput Format\r\nThe first line contains an integer t, the number of test cases.\r\nEach of the test cases has the following format:\r\nThe first line contains an integer n, the number of nodes in the first linked list.\r\nEach of the next n lines contains an integer, each a value for a data attribute.\r\nThe next line contains an integer m, the number of nodes in the second linked list.\r\nEach of the next m lines contains an integer, each a value for a data attribute.\r\n\r\nConstraints\r\n• 1 ≤ t ≤ 10\r\n• 1 ≤ n, m ≤ 1000\r\n• 1 ≤ llist1[i], llist2[i] ≤ 1000\r\n\r\nOutput Format\r\nCompare the two linked lists and return 1 if the lists are equal. Otherwise, return 0. Do NOT print anything to stdout/console.\r\nThe output is handled by the code in the editor and it is as follows:\r\nFor each test case, in a new line, print 1 if the two lists are equal, else print 0.\r\n\r\nSample Input\r\n 2\r\n 2\r\n 1\r\n 2\r\n 1\r\n 1\r\n 2\r\n 1\r\n 2\r\n 2\r\n 1\r\n 2\r\n\r\nSample Output\r\n 0\r\n 1\r\n\r\nExplanation\r\nThere are t = 2 test cases, each with a pair of linked lists.\r\n• In the first case, linked lists are: 1 -> 2 -> NULL and 1 -> NULL\r\n• In the second case, linked lists are: 1 -> 2 -> NULL and 1 -> 2 -> NULL","shortMessageHtmlLink":"Create CompareTwoLinkedLists0.py"}},{"before":"1e5e8e5adec69c3a0cd3803cf0682823cb0e4233","after":"8538b84a9b0ec4e9cfe9960b8f68e4c752bb9403","ref":"refs/heads/main","pushedAt":"2024-07-19T08:39:38.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Update InsertNodeAtLinkedListHead0.py\n\nGiven a pointer to the head of a linked list, insert a new node before the head. The 'next' value in the new node should point to 'head' and the 'data' value should be replaced with a given value. Return a reference to the new head of the list. The head pointer given may be null meaning that the initial list is empty.\r\n\r\nFunction Description\r\nComplete the function insertNodeAtHead in the editor below.\r\ninsertNodeAtHead has the following parameter(s):\r\n• SinglyLinkedListNode llist: a reference to the head of a list\r\n• data: the value to insert in the 'data' field of the new node\r\n\r\nInput Format\r\nThe first line contains an integer n, the number of elements to be inserted at the head of the list.\r\nThe next n lines contain an integer each, the elements to be inserted, one per function call.\r\n\r\nConstraints\r\n• 1 ≤ n ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000\r\n\r\nSample Input\r\n 5\r\n 383\r\n 484\r\n 392\r\n 975\r\n 321\r\n\r\nSample Output\r\n 321\r\n 975\r\n 392\r\n 484\r\n 383\r\n\r\nExplanation\r\nInitially the list in NULL. After inserting 383, the list is 383 -> NULL.\r\nAfter inserting 484, the list is 484 -> 383 -> NULL.\r\nAfter inserting 392, the list is 392 -> 484 -> 383 -> NULL.\r\nAfter inserting 975, the list is 975 -> 392 -> 484 -> 383 -> NULL.\r\nAfter inserting 321, the list is 321 -> 975 -> 392 -> 484 -> 383 -> NULL.","shortMessageHtmlLink":"Update InsertNodeAtLinkedListHead0.py"}},{"before":"c430d81d453e6d08c50f768b465005484202f7eb","after":"1e5e8e5adec69c3a0cd3803cf0682823cb0e4233","ref":"refs/heads/main","pushedAt":"2024-07-19T08:38:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Rename InsertHeadAtLinkedListHead2.py to InsertNodeAtLinkedListHead2.py","shortMessageHtmlLink":"Rename InsertHeadAtLinkedListHead2.py to InsertNodeAtLinkedListHead2.py"}},{"before":"883caf97146524648f0f1566aa68d0022cc5483c","after":"c430d81d453e6d08c50f768b465005484202f7eb","ref":"refs/heads/main","pushedAt":"2024-07-19T08:37:43.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create InsertHeadAtLinkedListHead2.py","shortMessageHtmlLink":"Create InsertHeadAtLinkedListHead2.py"}},{"before":"dc442c10525602534426030aa80d672794559cc4","after":"883caf97146524648f0f1566aa68d0022cc5483c","ref":"refs/heads/main","pushedAt":"2024-07-19T08:32:29.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create InsertNodeAtLinkedListHead1.py","shortMessageHtmlLink":"Create InsertNodeAtLinkedListHead1.py"}},{"before":"8b5e3e6f9540a295fb7cbab32f63db0bd570b83f","after":"dc442c10525602534426030aa80d672794559cc4","ref":"refs/heads/main","pushedAt":"2024-07-19T08:28:48.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create InsertNodeAtLinkedListHead0.py\n\nGiven a pointer to the head of a linked list, insert a new node before the head. The 'next' value in the new node should point to 'head' and the 'data' value should be replaced with a given value. Return a reference to the new head of the list. The head pointer given may be null meaning that the initial list is empty.\r\n\r\nFunction Description\r\nComplete the function insertNodeAtHead in the editor below.\r\ninsertNodeAtHead has the following parameter(s):\r\n• SinglyLinkedListNode llist: a reference to the head of a list\r\n• data: the value to insert in the 'data' field of the new node\r\n\r\nInput Format\r\nThe first line contains an integer n, the number of elements to be inserted at the head of the list.\r\nThe next n lines contain an integer each, the elements to be inserted, one per function call.\r\n\r\nConstraints\r\n• 1 ≤ n ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000\r\n\r\nSample Input\r\n 5\r\n 383\r\n 484\r\n 392\r\n 975\r\n 321\r\n\r\nSample Output\r\n 321\r\n 975\r\n 392\r\n 484\r\n 383\r\n\r\nExplanation\r\nInitially the list in NULL. After inserting 383, the list is 383 -> NULL.\r\nAfter inserting 484, the list is 484 -> 383 -> NULL.\r\nAfter inserting 392, the list is 392 -> 484 -> 383 -> NULL.\r\nAfter inserting 975, the list is 975 -> 392 -> 484 -> 383 -> NULL.\r\nAfter inserting 321, the list is 321 -> 975 -> 392 -> 484 -> 383 -> NULL.","shortMessageHtmlLink":"Create InsertNodeAtLinkedListHead0.py"}},{"before":"1970f19fbe805d99c8e014c3d9e4d17d430022ad","after":"8b5e3e6f9540a295fb7cbab32f63db0bd570b83f","ref":"refs/heads/main","pushedAt":"2024-07-18T20:04:41.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create GetNodeValue3.py","shortMessageHtmlLink":"Create GetNodeValue3.py"}},{"before":"139429f4f4edb3d661971de0c4b3304c96e93250","after":"1970f19fbe805d99c8e014c3d9e4d17d430022ad","ref":"refs/heads/main","pushedAt":"2024-07-18T20:01:31.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create GetNodeValue2.py","shortMessageHtmlLink":"Create GetNodeValue2.py"}},{"before":"6bedec3efb5a85847c0db12c0b2a14f93dda57f7","after":"139429f4f4edb3d661971de0c4b3304c96e93250","ref":"refs/heads/main","pushedAt":"2024-07-18T19:59:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create GetNodeValue1.py","shortMessageHtmlLink":"Create GetNodeValue1.py"}},{"before":"9a861fad58943200862906fee072a7b1280d35ee","after":"6bedec3efb5a85847c0db12c0b2a14f93dda57f7","ref":"refs/heads/main","pushedAt":"2024-07-18T19:56:03.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create GetNodeValue0.py\n\nGiven a pointer to the head of a linked list and a specific position, determine the data value at that position. Count backwards from the tail node. The tail is at postion 0, its parent is at 1 and so on.\r\n\r\nExample\r\nhead refers to 3 → 2 → 1 → 0 → NULL\r\npositionFromTail = 2\r\n\r\nEach of the data values matches its distance from the tail. The value 2 is at the desired position.\r\n\r\nFunction Description\r\nComplete the getNode function in the editor below.\r\ngetNode has the following parameters:\r\n• SinglyLinkedListNode pointer head: refers to the head of the list\r\n• int positionFromTail: the item to retrieve\r\n\r\nReturns\r\n• int: the value at the desired position\r\n\r\nInput Format\r\nThe first line contains an integer t, the number of test cases.\r\nEach test case has the following format:\r\nThe first line contains an integer n, the number of elements in the linked list.\r\nThe next n lines contains an integer, the data value for an element of the linked list.\r\nThe last line contains an integer positionFromTail, the position from the tail to retrieve the value of.\r\n\r\nConstraints\r\n• 1 ≤ t ≤ 10\r\n• 1 ≤ n, m ≤ 1000\r\n• 1 ≤ list[i] ≤ 1000, where list[i] is the iᵗʰ element of the linked list\r\n• 0 ≤ positionFromTail < n\r\n\r\nSample Input\r\n 2\r\n 1\r\n 1\r\n 0\r\n 3\r\n 3\r\n 2\r\n 1\r\n 2\r\n\r\nSample Output \r\n 1\r\n 3\r\n\r\nExplanation\r\nIn the first case, there is one element in linked list with a value of 1. The last (only) element contains 1.\r\nIn the second case, the list is 3 → 2 → 1 → NULL. The element with position of 2 from tail contains 3.","shortMessageHtmlLink":"Create GetNodeValue0.py"}},{"before":"0ec095eeee815f5c9116427aa38a37cfbb8504c2","after":"9a861fad58943200862906fee072a7b1280d35ee","ref":"refs/heads/main","pushedAt":"2024-07-17T11:39:58.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create ManasaAndSubsequences2.py","shortMessageHtmlLink":"Create ManasaAndSubsequences2.py"}},{"before":"01ceb1e0dbdca4b60507a9d6d7bc90ca2d40dc78","after":"0ec095eeee815f5c9116427aa38a37cfbb8504c2","ref":"refs/heads/main","pushedAt":"2024-07-17T07:53:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create ManasaAndSubsequences1.py","shortMessageHtmlLink":"Create ManasaAndSubsequences1.py"}},{"before":"a7abd2f7d5c791002b24ba8d2309d81666337857","after":"01ceb1e0dbdca4b60507a9d6d7bc90ca2d40dc78","ref":"refs/heads/main","pushedAt":"2024-07-17T07:51:00.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create ManasaAndSubsequences0.py\n\nManasa recently lost a bet to Amit. To settle the problem, they are playing a game:\r\n\r\nThey have N balls in front of them. Each ball, except the 1st ball, is numbered from 0 to 9. The 1st ball is numbered from 1 to 9.\r\n\r\nAmit calculates all the subsequences [https://en.wikipedia.org/wiki/Subsequence] of the number thus formed. Each subsequence of sequence S is represented by Sₖ.\r\n\r\ne.g. S = 1 2 3\r\n\r\nS₀ = 1 2 3,\r\nS₁ = 1 2,\r\nS₂ = 1 3,\r\nS₃ = 2 3,\r\nS₄ = 1,\r\nS₅ = 2, and\r\nS₆ = 3.\r\n\r\nEach subsequence Sₖ also represents a number. e.g. S₁ represents twelve, S₂ represents thirteen.\r\n\r\nNow Manasa has to throw Sₖ candies into an initially empty box, where k goes from 0 to ( maximum number of subsequences - 1).\r\n\r\nAt the end of the game, Manasa has to find out the total number of candies, T, in the box. As T can be large, Amit asks Manasa to tell T % (10⁹ + 7 ). If Manasa answers correctly, she can keep all the candies. Manasa can't take all this Math and asks for your help.\r\n\r\nHelp her!\r\n\r\nNote: A subsequence can also be have preceding zeros. For example, the sequence 103 has subsequences 103, 10, 13, 03, 1, 0, and 3 (so both 03 and 3 are counted separately).\r\n\r\nInput Format\r\nA single line containing a number having N digits.\r\n\r\nOutput Format\r\nA number containing the output.\r\n\r\nConstraints\r\n• 1 ≤ N ≤ 2*10⁵\r\n\r\nSample Input 00\r\n 111\r\n\r\nSample Output 00\r\n 147\r\n\r\nSample Input 01\r\n 123\r\n\r\nSample Output 01\r\n 177\r\n\r\nExplanation\r\nThe subsequence of number 111 are 111, 11 , 11, 11, 1, 1 and 1. Whose sum is 147.\r\n\r\nThe subsequence of number 123 are 123, 12 , 23, 13, 1, 2 and 3. Whose sum is 177.","shortMessageHtmlLink":"Create ManasaAndSubsequences0.py"}},{"before":"f8a2dfbbc50b133fadd24342e94e88af0d42d6c9","after":"a7abd2f7d5c791002b24ba8d2309d81666337857","ref":"refs/heads/main","pushedAt":"2024-07-16T07:10:38.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create StrangeGridAgain1.py","shortMessageHtmlLink":"Create StrangeGridAgain1.py"}},{"before":"63c3d2b2b85cff3245190a186f309b44f433de93","after":"f8a2dfbbc50b133fadd24342e94e88af0d42d6c9","ref":"refs/heads/main","pushedAt":"2024-07-16T07:06:36.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Update StrangeGridAgain0.py\n\nA strange grid has been recovered from an old book. It has columns and infinite number of rows. The bottom row is considered as the first row. First few rows of the grid are like this:\r\n\r\n ................................\r\n\r\n ................................\r\n\r\n 20 22 24 26 28\r\n\r\n 11 13 15 17 19\r\n\r\n 10 12 14 16 18\r\n\r\n 1 3 5 7 9\r\n\r\n 0 2 4 6 8\r\n\r\nThe grid grows upwards forever!\r\nYour task is to find the integer in cᵗʰ column in rᵗʰ row of the grid.\r\n\r\nInput Format\r\nThere will be two integers r and c separated by a single space.\r\n\r\nConstraints\r\n• 1 ≤ r ≤ 2 × 10⁹\r\n• 1 ≤ c ≤ 5\r\n\r\nRows are indexed from bottom to top and columns are indexed from left to right.\r\n\r\nOutput Format\r\nOutput the answer in a single line.\r\n\r\nSample Input \r\n 6 3\r\n\r\nSample Output\r\n 25\r\n\r\nExplanation\r\nThe number in the 6ᵗʰ row and 3ʳᵈ column is 25.","shortMessageHtmlLink":"Update StrangeGridAgain0.py"}},{"before":"6cbd149678646ffa735e34262fc61a2df160a81b","after":"63c3d2b2b85cff3245190a186f309b44f433de93","ref":"refs/heads/main","pushedAt":"2024-07-16T07:04:57.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create StrangeGridAgain0.py\n\nA strange grid has been recovered from an old book. It has columns and infinite number of rows. The bottom row is considered as the first row. First few rows of the grid are like this:\r\n\r\n ................................\r\n\r\n ................................\r\n\r\n 20 22 24 26 28\r\n\r\n 11 13 15 17 19\r\n\r\n 10 12 14 16 18\r\n\r\n 1 3 5 7 9\r\n\r\n 0 2 4 6 8\r\n\r\nThe grid grows upwards forever!\r\nYour task is to find the integer in cᵗʰ column in rᵗʰ row of the grid.\r\n\r\nInput Format\r\nThere will be two integers r and c separated by a single space.\r\n\r\nConstraints\r\n• 1 ≤ r ≤ 2 × 10⁹\r\n• 1 ≤ c ≤ 5\r\n\r\nRows are indexed from bottom to top and columns are indexed from left to right.\r\n\r\nOutput Format\r\nOutput the answer in a single line.\r\n\r\nSample Input \r\n 6 3\r\n\r\nSample Output\r\n 25\r\n\r\nExplanation\r\nThe number in the 6ᵗʰ row and 3ʳᵈ column is 25.","shortMessageHtmlLink":"Create StrangeGridAgain0.py"}},{"before":"8e60f550ee9d138d29fc5d05f0ed125df6f407da","after":"6cbd149678646ffa735e34262fc61a2df160a81b","ref":"refs/heads/main","pushedAt":"2024-07-15T09:08:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create TellTheAverage6.py","shortMessageHtmlLink":"Create TellTheAverage6.py"}},{"before":"b07bf31b35faefdd2e1afdbf05ba811ef1e0b431","after":"8e60f550ee9d138d29fc5d05f0ed125df6f407da","ref":"refs/heads/main","pushedAt":"2024-07-12T21:15:41.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"Chukwudebelu","name":"Chisom Anumba","path":"/Chukwudebelu","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/32755252?s=80&v=4"},"commit":{"message":"Create SteppingStones2.py","shortMessageHtmlLink":"Create SteppingStones2.py"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"startCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wNy0zMVQyMTowMzo0My4wMDAwMDBazwAAAASOfU8K","endCursor":"Y3Vyc29yOnYyOpK7MjAyNC0wNy0xMlQyMToxNTo0MS4wMDAwMDBazwAAAAR-O8zv"}},"title":"Activity · Chukwudebelu/HackerRank"}