Skip to content

Instantly share code, notes, and snippets.

@ohbadiah
ohbadiah / theraven.txt
Created August 25, 2020 14:09
Poe's "The Raven"
Once upon a midnight dreary, while I pondered, weak and weary,
Over many a quaint and curious volume of forgotten lore—
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
“’Tis some visitor,” I muttered, “tapping at my chamber door—
Only this and nothing more.”
Ah, distinctly I remember it was in the bleak December;
And each separate dying ember wrought its ghost upon the floor.
Eagerly I wished the morrow;—vainly I had sought to borrow
Download the below files. You can either download them ahead of time or have
your code fetch them with an HTTP call.
- https://gitlab.com/snippets/1982573/raw
- https://gitlab.com/snippets/1982576/raw
These files contain a list of companies, where each company has a name and a
website. Your program should print the name and domain of each company that
overlaps between the two data sets. Use the programming language and
environment of your choice
@ohbadiah
ohbadiah / max-difference
Created May 12, 2020 15:57
Algorithm practice #2
You are given an array of integers.
Can you find the maximum difference between any two integers in the array,
with the restriction that the larger integer follows the smaller one?
For example:
[7 8 9 4 3 1 2] => 2
@ohbadiah
ohbadiah / infix-prefix
Last active September 17, 2020 13:29
Infix-prefix coding problem
We have some expressions, represented as a list where every term is either:
- A variable (e.g. A, B, C)
- A boolean operator (AND or OR)
- A nested expression (list)
You're presented an expression with infix operators, like:
[A AND [B OR C]]
Can you transform these expressions so the operators are in prefix order? The output for this case is: