partially solved the problem for fraud prevention problem at
https://www.hackerrank.com/challenges/fraud-prevention