All Problems

Problem title

Difficulty

Avg time to solve

Nth Fibonacci Number

Easy

--

Median of two sorted arrays

Hard

25 mins

Fire in the cells.

Hard

15 mins

Floor in BST

Moderate

30 mins

Size of Largest BST in Binary Tree

Easy

10 mins

Kth Smallest Element

Easy

15 mins

Rearrange The Array

Moderate

15 mins

Level Order Traversal

Easy

15 mins

Count Ways

Easy

24 mins

Sum Between Zeroes

Easy

20 mins

Problem

Submissions

18

Difficulty: EASY

Problem Statement

```
F(n) = F(n-1) + F(n-2),
Where, F(1) = F(2) = 1
```

```
The first line of each test case contains a real number ‘N’.
```

```
For each test case, return its equivalent Fibonacci number.
```

```
1 <= N <= 10000
Where ‘N’ represents the number for which we have to find its equivalent Fibonacci number.
Time Limit: 1 second
```

```
6
```

```
8
```

```
Now the number is ‘6’ so we have to find the “6th” Fibonacci number
So by using the property of the Fibonacci series i.e
[ 1, 1, 2, 3, 5, 8]
So the “6th” element is “8” hence we get the output.
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code