Topic
Scala
A browsable archive of writing and notes across the site.
Post
Notes on singly linked lists
Cyclic singly linked lists — linked lists that contain a loop — come up in a lot of interview questions. This post is a roundup, partly for reference and partly to sort out my own …
Post
[151] Reverse Words in a String
Problem: Reverse Words in a String Given an input string s, reverse the string word by word. For example, given s = “the sky is blue”, return “blue is sky …
Post
Two Sum
This post covers two LeetCode problems: Two Sum I and Two Sum II. Problem 1: 1. Two Sum Given an array of integers, find two numbers such that they add up to a specific target …
Post
[160] Intersection of Two Linked Lists
Problem: Intersection of Two Linked Lists Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: …
Post
Notes on Lambda
Of all the new features in C++11, the ones I’ve been bumping into the most lately are threads and lambda expressions. This post is mostly about lambda usage — partly to …
Post
[152] Maximum Product Subarray
Problem Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous …
Post
Scala Day 2
I’ve been working through the Coursera course Principles of Reactive Programming the past few days. I hadn’t realised it expected a solid foundation in at least one …