Here's my Java solution for HackerRank and Cracking the Code Interview's Arrays: Left Rotation problem. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int[] arrayLeftRotation(int[] a
Read More

Here's my Java solution for HackerRank and Cracking the Code Interview's Hash Tables: Ransom Note problem. import java.util.*; public class Solution { Map<String, Integer> magazineMap; Map<String, Integer> noteMap; public Solution(String magazine, String note
Read More

Here's my Java solution for HackerRank and Cracking the Code Interview's Linked Lists: Detect a Cycle problem. boolean hasCycle(Node head) { if (head == null) return false; Node slow = head; Node fast = head; while (true) { slow = slow.next; if (fast.next
Read More

Here's my Java solution for HackerRank and Cracking the Code Interview's String: Making Anagrams problem. import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int numberNeeded(String first
Read More

If you are publishing Docker containers from SBT, you might need to publish containers before running them on tests. It would be nice to have a task that would automatically publish these containers and then run a single test, like
Read More

If you are using Spark Streaming Kafka Direct API and you are storing offsets in Zookeeper, you might want to reuse offsets from Zookeeper and not always rely on checkpoint. KafkaUtils.createDirectStream() has a fromOffsets parameter which you can provide
Read More

If you are using Spark Streaming's new Kafka Direct API you might be missing some things, like monitoring tools that only work with offsets in ZK. For example, Kafka's kafka-consumer-offset-checker.sh which is very helpful to check consumer lag, meaning
Read More

I've been having some fun doing Codility exercises now that they have Scala support. Here's my solution for their Nesting exercise. object Solution { def solution(S: String): Int = { val results = S.foldLeft(0) { (total, chr) => if (total < 0
Read More

I am currently taking Stanford's Algorithms: Design and Analysis, Part 1 class on Coursera. I wanted to share my solutions which I am writing in Scala. Week 2 is mostly about QuickSort. QuickSort - Recursive, In-place package algo import scala
Read More

I am currently taking Stanford's Algorithms: Design and Analysis, Part 1 class on Coursera. I wanted to share my solutions which I am writing in Scala. Count Inversions using Merge Sort package algo import scala.math import Ordering.Implicits._ import
Read More