Skip to content

Commit 19d0862

Browse files
committed
Merge branch 'main' of github.com:All3yp/Daily-Coding-problems
2 parents 1c520cc + f1a50a1 commit 19d0862

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

Readme.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
77
## 🚀 Problem 1 [Easy]
88

9-
This problem was recently asked by Google.
9+
#### This problem was recently asked by Google.
1010

11-
Given a list of numbers and a number k, return whether any two numbers
12-
rom the list add up to k.
13-
For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
11+
Given a list of numbers and a number `k`, return whether any two numbers
12+
rom the list add up to `k`.
13+
For example, given `[10, 15, 3, 7]` and `k` of `17`, return true since `10 + 7` is `17`.
1414

1515
Bonus: Can you do this in one pass?
1616

@@ -20,15 +20,15 @@ Bonus: Can you do this in one pass?
2020

2121
## 🚀 Problem 2 [Easy]
2222

23-
This problem was asked by Uber.
23+
#### This problem was asked by Uber.
2424

2525
Given an array of integers, return a new array such that each element
26-
at index i of the new array is the product of all the numbers in the
27-
original array except the one at i.
26+
at index `i` of the new array is the product of all the numbers in the
27+
original array except the one at `i`.
2828

29-
For example, if our input was [1, 2, 3, 4, 5], the expected output
30-
would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1],
31-
the expected output would be [2, 3, 6].
29+
For example, if our input was `[1, 2, 3, 4, 5]`, the expected output
30+
would be `[120, 60, 40, 30, 24]`. If our input was `[3, 2, 1]`,
31+
the expected output would be `[2, 3, 6]`.
3232

3333
Follow-up: what if you can't use division?
3434

@@ -38,9 +38,9 @@ Follow-up: what if you can't use division?
3838

3939
## 🚀 Problem 3 [Medium]
4040

41-
This problem was asked by Google.
41+
#### This problem was asked by Google.
4242

43-
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.
43+
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.
4444

4545
For example, given the following Node class
4646

@@ -70,7 +70,7 @@ expect(deserialize(serialize(node)).left.left.val).toEqual('left.left');
7070

7171
## 🚀 Problem 4 [Hard]
7272

73-
This problem was asked by Stripe.
73+
#### This problem was asked by Stripe.
7474

7575
Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.
7676

@@ -84,9 +84,9 @@ You can modify the input array in-place.
8484

8585
## 🚀 Problem 5 [Medium]
8686

87-
This problem was asked by Jane Street.
87+
#### This problem was asked by Jane Street.
8888

89-
cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.
89+
`cons(a, b)` constructs a pair, and `car(pair)` and `cdr(pair)` returns the first and last element of that pair. For example, `car(cons(3, 4))` returns 3, and `cdr(cons(3, 4))` returns 4.
9090

9191
Given this implementation of cons:
9292

@@ -109,7 +109,7 @@ Implement car and cdr.
109109

110110
## 🚀 Problem 6 [Hard]
111111

112-
This problem was asked by Google.
112+
#### This problem was asked by Google.
113113

114114
An XOR linked list is a more memory efficient doubly linked list. 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. Implement an XOR linked list; it has an `add(element)` which adds the element to the end, and a `get(index)` which returns the node at index.
115115

@@ -122,13 +122,11 @@ If using a language that has no pointers (such as Python), you can assume you ha
122122

123123
## 🚀 Problem 7 [Medium]
124124

125-
This problem was asked by Facebook.
125+
#### This problem was asked by Facebook.
126126

127-
Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.
128-
129-
For example, the message '111' would give 3, since it could be decoded as 'aaa', 'ka', and 'ak'.
130-
131-
You can assume that the messages are decodable. For example, '001' is not allowed.
127+
Given the mapping `a = 1, b = 2, ... z = 26`, and an encoded message, count the number of ways it can be decoded.
128+
For example, the message `'111'` would give 3, since it could be decoded as `'aaa'`, `'ka'`, and `'ak'`.
129+
You can assume that the messages are decodable. For example, `'001'` is not allowed.
132130

133131
[Solution 🎉](https://github.com/All3yp/Daily-Coding-problems/blob/main/Daily_Coding_Problem-07.cpp)
134132
#### Click [__*here*__](https://leetcode.com/problems/decode-ways/) to visit this question on [*LeetCode*](https://leetcode.com/).

0 commit comments

Comments
 (0)