![]() Instead of each node holding next and prev fields, it holds a field named both, which is an XOR of the next node and the previous node. ![]() For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.Īn XOR linked list is a more memory efficient doubly linked list. The input should give 3.Ĭons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. The array can contain duplicates and negative numbers as well.įor example, the input should give 2. In other words, find the lowest positive integer that does not exist in the array. Given an array of integers, find the first missing positive integer in linear time and constant space. Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree. įollow-up: what if you can't use division? ![]() If our input was, the expected output would be. Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.įor example, if our input was, the expected output would be. Given a list of numbers, return whether any two sums to k.įor example, given and k of 17, return true since 10 + 7 is 17. ![]() Some solutions require an additional Data Structures module.Modules numpy and matplotlib are used for presentation purpose only and hence are optional.Please go through Contribution Guidelines before you contribute. Install the 3rd party packages, perform the following steps: This repository contains the Daily Coding Problem solutions in python. ![]()
0 Comments
Leave a Reply. |