Skip to content

Commit b94c8b2

Browse files
committed
updated as per your sugession
2 parents 4dfdb7b + d92c3c5 commit b94c8b2

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

dsa-solutions/gfg-solutions/0004-fibbonacci-sum.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ This tutorial contains a complete walk-through of the Fibonacci Sum problem from
1414

1515
## Problem Description
1616

17-
Given a positive number N, find the value of f0 + f1 + f2 + ... + fN where fi indicates the ith Fibonacci number. Note that f0 = 0, f1 = 1, f2 = 1, f3 = 2, f4 = 3, f5 = 5, and so on. Since the answer can be very large, return the result modulo 1000000007.
17+
Given a positive number N, find the value of $f0 + f1 + f2 + ... + fN$ where fi indicates the ith Fibonacci number. Note that $f0 = 0, f1 = 1, f2 = 1, f3 = 2, f4 = 3, f5 = 5,$ and so on. Since the answer can be very large, return the result modulo $1000000007$.
1818

1919
## Examples
2020

21-
```
2221
**Example 1:**
23-
22+
```
2423
Input:
2524
N = 3
2625
Output:
@@ -29,17 +28,14 @@ Explanation:
2928
0 + 1 + 1 + 2 = 4
3029
```
3130

32-
```
3331
**Example 2:**
34-
35-
32+
```
3633
Input:
3734
N = 4
3835
Output:
3936
7
4037
Explanation:
4138
0 + 1 + 1 + 2 + 3 = 7
42-
4339
```
4440

4541
## Your Task
@@ -267,3 +263,7 @@ By leveraging the properties of Fibonacci numbers and matrix multiplication, we
267263
- **GeeksforGeeks Problem:** [Geeks for Geeks Problem](https://www.geeksforgeeks.org/problems/fibonacci-sum/0)
268264
- **Solution Link:** [Fibonacci Sum on Geeks for Geeks](https://www.geeksforgeeks.org/problems/fibonacci-sum/0)
269265
- **Authors GeeksforGeeks Profile:** [Vipul](https://www.geeksforgeeks.org/user/lakumvipwjge/)
266+
267+
```
268+
This structured tutorial provides a comprehensive solution to the Fibonacci Sum problem, making it easy for others to understand and implement in various programming languages.
269+
```

dsa-solutions/gfg-solutions/0005-next-happy-number.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ The numbers that, when you repeatedly sum the squares of their digits, eventuall
7979
Here are examples of how to determine if numbers less than 10 are happy numbers:
8080

8181
- **Number 1:**
82+
8283
$[1 ^ 2 = 1]$
8384
Since we have already reached 1, the process stops here. 1 is a happy number.
8485

8586
- **Number 2:**
8687

87-
```
8888
$[2^2 = 4]$
8989
$[4^2 = 16]$
9090
$[1^2 + 6^2 = 37]$
@@ -94,38 +94,41 @@ Here are examples of how to determine if numbers less than 10 are happy numbers:
9494
$[1^2 + 4^2 + 5^2 = 42]$
9595
$[4^2 + 2^2 = 20]$
9696
$[2^2 + 0^2 = 4]$
97-
98-
Since we have reached 4 again, the process will continue in an infinite loop. 2 is not a happy number.
99-
```
97+
98+
Since we have reached 4 again, the process will continue in an infinite loop. 2 is not a happy number.
10099

101100
- **Number 3:**
101+
102102
Similar to the above steps, 3 will also enter a loop and is not a happy number.
103103

104104
- **Number 4:**
105+
105106
Similar to the above steps, 4 will also enter a loop and is not a happy number.
106107

107108
- **Number 5:**
109+
108110
Similar to the above steps, 5 will also enter a loop and is not a happy number.
109111

110112
- **Number 6:**
113+
111114
Similar to the above steps, 6 will also enter a loop and is not a happy number.
112115

113116
- **Number 7:**
114117

115-
```
116118
$[7^2 = 49]$
117119
$[4^2 + 9^2 = 97]$
118120
$[9^2 + 7^2 = 130]$
119121
$[1^2 + 3^2 + 0^2 = 10]$
120122
$[1^2 + 0^2 = 1]$
121123

122124
Since we have reached 1, the process stops here. 7 is a happy number.
123-
```
124125

125126
- **Number 8:**
127+
126128
Similar to the above steps, 8 will also enter a loop and is not a happy number.
127129

128130
- **Number 9:**
131+
129132
Similar to the above steps, 9 will also enter a loop and is not a happy number.
130133

131134
Based on this analysis, the numbers less than 10 that result in 1 when you repeatedly sum the squares of their digits are: 1 and 7.

0 commit comments

Comments
 (0)