Recursion-1 > bunnyEars

We have a number of bunnies and each bunny has two big floppy ears. We want to compute the total number of ears across all the bunnies recursively (without loops or multiplication).

bunnyEars(0) → 0
bunnyEars(1) → 2
bunnyEars(2) → 4

public int bunnyEars(int bunnies) {
   return 0;

   return 2+ bunnyEars(bunnies-1);


Recursion-1 > factorial

Given n of 1 or more, return the factorial of n, which is n * (n-1) * (n-2) ... 1. Compute the result recursively (without loops).

factorial(1) → 1
factorial(2) → 2
factorial(3) → 6

public int factorial(int n) {
  if(n==1 || n==0)
   return 1;
   return n*factorial(n-1);

How to hide generated javascript file in visual studio code

In this post I am going to show you a cool trick in visual studio code. Let's suppose you are writing typescript code in visual studio code and you want to hide generated javascript code.

Create .vscode folder in your folder and then create settings.json file and paste following code

    "files.exclude": {
        "**/*.js": {"when""$(basename).ts"}