This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const app = express(); | |
| app.use(express.json); | |
| const PORT = process.env.PORT || 8000; | |
| app.listen(PORT, ()=>{ | |
| console.log(`[Server Started] Server is running on ${PORT}`); | |
| }); | |
| const arr=[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Weak2 { | |
| /* | |
| 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 |