About me

About me

I have a passion to solve problems, I like to be challenged and i like it even better when I manage to overcome it, that can definitely make my day. I’ve been thinking about sharing some of my work for quite some time now and finally i have decided to actually spend the time and share some of my solutions and ideas with the community.

Easy logging rxjs

import {Observable} from ‘rxjs’; import {tap} from ‘rxjs/operators’; export enum RxJsLoggingLevel { TRACE, DEBUG, INFO, WARN, ERROR } let rxjsLoggingLevel = RxJsLoggingLevel.TRACE; export function setRxJsLoggingLevel(level:

Read More »

Lowest Common Ancestor of a Binary Tree

class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { if (root==null || root==p || root==q) return root; TreeNode left = lowestCommonAncestor(root.left,p,q); TreeNode

Read More »

Making A Large Island

class Solution { public int largestIsland(int[][] grid) { if (grid.length==0) return 0; Map map = mapIslands(grid); int max = map.values().stream().reduce(Integer::max).get(); for (int i = 0;

Read More »

Debouncing a function

I will start with a very common use case – say we have events that occurs a lot and in random, sometimes small intervals and

Read More »