Skip to content

Commit 4dfdb7b

Browse files
committed
Next Happy Number solution added
1 parent e5e7df2 commit 4dfdb7b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ For a given non-negative integer N, find the next smallest Happy Number. A numbe
2222

2323
```
2424
input:
25-
2625
N = 8
2726
2827
Output:
29-
3028
10
31-
3229
```
3330

3431
Explanation:
@@ -39,13 +36,10 @@ $[ 1 * 1 + 0 * 0 = 1]$
3936

4037
```
4138
Input:
42-
4339
N = 10
4440
4541
Output:
46-
4742
13
48-
4943
```
5044

5145
Explanation:
@@ -124,6 +118,7 @@ Here are examples of how to determine if numbers less than 10 are happy numbers:
124118
$[9^2 + 7^2 = 130]$
125119
$[1^2 + 3^2 + 0^2 = 10]$
126120
$[1^2 + 0^2 = 1]$
121+
127122
Since we have reached 1, the process stops here. 7 is a happy number.
128123
```
129124

0 commit comments

Comments
 (0)