Skip to content

Instantly share code, notes, and snippets.

View samiullah-dev's full-sized avatar

Sami Ullah samiullah-dev

View GitHub Profile
Q1. 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
bunnyEars(234) → 468
________________________________________________________________________________________________________________________________________
package projects;
import java.util.*;
public class FloppyEars {