Please find the logic to perform the below request withot using the while loops.
Input |
| OutPut |
Row | Person |
| row | person | Count |
1 | 101 |
| 1 | 101 | 1 |
1 | 102 |
| 1 | 102 | 1 |
1 | 103 |
| 1 | 103 | 1 |
2 | 101 |
| 2 | 101 | 2 |
2 | 102 |
| 2 | 102 | 2 |
2 | 104 |
| 2 | 103 | 1 |
3 | 101 |
| 2 | 104 | 1 |
3 | 103 |
| 3 | 101 | 3 |
3 | 105 |
| 3 | 102 | 2 |
|
|
| 3 | 103 | 3 |
|
|
| 3 | 104 | 1 |
|
|
| 3 | 105 | 1 |