Farhan Mannan

Farhan Mannan

Scala program to get sizes and number of contiguous blocks in a matrix

// 1000 // 1001 // 0111 The above has two contiguous blocks of sizes 2 and 4 (I’m not counting diagonals as contiguous). The auxiliary constructor for the class Grid takes a height and width argument and creates a random matrix. You can then invoke the numBlocks method and access the blockSizes field on your [...]

A Google Internship Interview Question in Scala

Isn’t it weird how sorting transforms the complexity of a solution? It must be a special case of some concept of “transformations” in complexity theory or something. Tell me if this is true. The Question The question is: given a sorted array of integers and a target integer, find a pair of integers in the [...]

Transclusion

Here’s some enlightening info about XanaduSpace. If you have no idea what’s going on, read it. Ted Nelson gave a talk at school today. He handed out some copies of ZigZag and Xanadu and demoed XanaduSpace. Having heard about it for ages and seeing demonstrations in other videos scattered across the web, it was great [...]