Skip to content

Commit 43ac5a4

Browse files
committed
update and fix bug
2 parents 04a9d23 + 2f60af0 commit 43ac5a4

File tree

8 files changed

+1962
-1966
lines changed

8 files changed

+1962
-1966
lines changed

dsa-problems/gfg-problems/easy/0601-0700.md

Lines changed: 602 additions & 604 deletions
Large diffs are not rendered by default.

dsa-problems/gfg-problems/medium/0501-0600.md

Lines changed: 602 additions & 603 deletions
Large diffs are not rendered by default.

dsa-problems/gfg-problems/school/0001-0100.md

Lines changed: 602 additions & 603 deletions
Large diffs are not rendered by default.

dsa-problems/gfg-problems/school/0101-0123.md

Lines changed: 140 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -8,153 +8,152 @@ keywords:
88
- gfg problems problems
99
---
1010

11-
1211
export const problems = [
13-
{
14-
"difficulty": "School",
15-
"gfgLink": "https://www.geeksforgeeks.org/problems/automorphic-number4721/1",
16-
"solutionLink": "#",
17-
"problemName": "Automorphic Number"
18-
},
19-
{
20-
"difficulty": "School",
21-
"gfgLink": "https://www.geeksforgeeks.org/problems/triangle-shrinking-downwards0459/1",
22-
"solutionLink": "#",
23-
"problemName": "Triangle shrinking downwards"
24-
},
25-
{
26-
"difficulty": "School",
27-
"gfgLink": "https://www.geeksforgeeks.org/problems/diagonal-sum0158/1",
28-
"solutionLink": "#",
29-
"problemName": "Diagonal sum"
30-
},
31-
{
32-
"difficulty": "School",
33-
"gfgLink": "https://www.geeksforgeeks.org/problems/sum-of-an-ap1025/1",
34-
"solutionLink": "#",
35-
"problemName": "Sum of an AP"
36-
},
37-
{
38-
"difficulty": "School",
39-
"gfgLink": "https://www.geeksforgeeks.org/problems/area-of-rectange-right-angled-triangle-and-circle2600/1",
40-
"solutionLink": "#",
41-
"problemName": "Area of Rectangle, Right Angled Triangle and Circle"
42-
},
43-
{
44-
"difficulty": "School",
45-
"gfgLink": "https://www.geeksforgeeks.org/problems/find-difference-between-sum-of-diagonals1554/1",
46-
"solutionLink": "#",
47-
"problemName": "Find difference between sum of diagonals"
48-
},
49-
{
50-
"difficulty": "School",
51-
"gfgLink": "https://www.geeksforgeeks.org/problems/front-back-transformation1659/1",
52-
"solutionLink": "#",
53-
"problemName": "Front-Back Transformation - copy"
54-
},
55-
{
56-
"difficulty": "School",
57-
"gfgLink": "https://www.geeksforgeeks.org/problems/addition-of-two-square-matrices4916/1",
58-
"solutionLink": "#",
59-
"problemName": "Addition of two square matrices"
60-
},
61-
{
62-
"difficulty": "School",
63-
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-subtraction1708/1",
64-
"solutionLink": "#",
65-
"problemName": "12 hour clock subtraction"
66-
},
67-
{
68-
"difficulty": "School",
69-
"gfgLink": "https://www.geeksforgeeks.org/problems/java-classes-introduction/1",
70-
"solutionLink": "#",
71-
"problemName": "Java Classes Introduction"
72-
},
73-
{
74-
"difficulty": "School",
75-
"gfgLink": "https://www.geeksforgeeks.org/problems/number-of-diagonals1020/1",
76-
"solutionLink": "#",
77-
"problemName": "Number of Diagonals"
78-
},
79-
{
80-
"difficulty": "School",
81-
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-addition1206/1",
82-
"solutionLink": "#",
83-
"problemName": "12 hour clock addition"
84-
},
85-
{
86-
"difficulty": "School",
87-
"gfgLink": "https://www.geeksforgeeks.org/problems/checcheck-if-two-given-circles-touch-each-other5038/1",
88-
"solutionLink": "#",
89-
"problemName": "Check if two given circles touch each other"
90-
},
91-
{
92-
"difficulty": "School",
93-
"gfgLink": "https://www.geeksforgeeks.org/problems/combinational-logic1908/1",
94-
"solutionLink": "#",
95-
"problemName": "Combinational Logic"
96-
},
97-
{
98-
"difficulty": "School",
99-
"gfgLink": "https://www.geeksforgeeks.org/problems/java-abstract-keyword/1",
100-
"solutionLink": "#",
101-
"problemName": "Java Abstract keyword"
102-
},
103-
{
104-
"difficulty": "School",
105-
"gfgLink": "https://www.geeksforgeeks.org/problems/compound-interest0235/1",
106-
"solutionLink": "#",
107-
"problemName": "Compound Interest"
108-
},
109-
{
110-
"difficulty": "School",
111-
"gfgLink": "https://www.geeksforgeeks.org/problems/program-to-print-reciprocal-of-letters36233623/1",
112-
"solutionLink": "#",
113-
"problemName": "Program to print reciprocal of letters"
114-
},
115-
{
116-
"difficulty": "School",
117-
"gfgLink": "https://www.geeksforgeeks.org/problems/determine-focal-length-of-a-spherical-mirror5415/1",
118-
"solutionLink": "#",
119-
"problemName": "Determine focal length of a spherical mirror"
120-
},
121-
{
122-
"difficulty": "School",
123-
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-multiplication4709/1",
124-
"solutionLink": "#",
125-
"problemName": "12 hour clock Multiplication "
126-
},
127-
{
128-
"difficulty": "School",
129-
"gfgLink": "https://www.geeksforgeeks.org/problems/number-pattern0517/1",
130-
"solutionLink": "#",
131-
"problemName": "Number Pattern"
132-
},
133-
{
134-
"difficulty": "School",
135-
"gfgLink": "https://www.geeksforgeeks.org/problems/parallel-or-perpendicular4257/1",
136-
"solutionLink": "#",
137-
"problemName": "Parallel or Perpendicular?"
138-
},
139-
{
140-
"difficulty": "School",
141-
"gfgLink": "https://www.geeksforgeeks.org/problems/decimal-to-any-base-conversion2440/1",
142-
"solutionLink": "#",
143-
"problemName": "Decimal to any base conversion"
144-
},
145-
{
146-
"difficulty": "School",
147-
"gfgLink": "https://www.geeksforgeeks.org/problems/time-to-words3728/1",
148-
"solutionLink": "#",
149-
"problemName": "Time to Words"
150-
}
12+
{
13+
"difficulty": "School",
14+
"gfgLink": "https://www.geeksforgeeks.org/problems/automorphic-number4721/1",
15+
"solutionLink": "#",
16+
"problemName": "Automorphic Number"
17+
},
18+
{
19+
"difficulty": "School",
20+
"gfgLink": "https://www.geeksforgeeks.org/problems/triangle-shrinking-downwards0459/1",
21+
"solutionLink": "#",
22+
"problemName": "Triangle shrinking downwards"
23+
},
24+
{
25+
"difficulty": "School",
26+
"gfgLink": "https://www.geeksforgeeks.org/problems/diagonal-sum0158/1",
27+
"solutionLink": "#",
28+
"problemName": "Diagonal sum"
29+
},
30+
{
31+
"difficulty": "School",
32+
"gfgLink": "https://www.geeksforgeeks.org/problems/sum-of-an-ap1025/1",
33+
"solutionLink": "#",
34+
"problemName": "Sum of an AP"
35+
},
36+
{
37+
"difficulty": "School",
38+
"gfgLink": "https://www.geeksforgeeks.org/problems/area-of-rectange-right-angled-triangle-and-circle2600/1",
39+
"solutionLink": "#",
40+
"problemName": "Area of Rectangle, Right Angled Triangle and Circle"
41+
},
42+
{
43+
"difficulty": "School",
44+
"gfgLink": "https://www.geeksforgeeks.org/problems/find-difference-between-sum-of-diagonals1554/1",
45+
"solutionLink": "#",
46+
"problemName": "Find difference between sum of diagonals"
47+
},
48+
{
49+
"difficulty": "School",
50+
"gfgLink": "https://www.geeksforgeeks.org/problems/front-back-transformation1659/1",
51+
"solutionLink": "#",
52+
"problemName": "Front-Back Transformation - copy"
53+
},
54+
{
55+
"difficulty": "School",
56+
"gfgLink": "https://www.geeksforgeeks.org/problems/addition-of-two-square-matrices4916/1",
57+
"solutionLink": "#",
58+
"problemName": "Addition of two square matrices"
59+
},
60+
{
61+
"difficulty": "School",
62+
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-subtraction1708/1",
63+
"solutionLink": "#",
64+
"problemName": "12 hour clock subtraction"
65+
},
66+
{
67+
"difficulty": "School",
68+
"gfgLink": "https://www.geeksforgeeks.org/problems/java-classes-introduction/1",
69+
"solutionLink": "#",
70+
"problemName": "Java Classes Introduction"
71+
},
72+
{
73+
"difficulty": "School",
74+
"gfgLink": "https://www.geeksforgeeks.org/problems/number-of-diagonals1020/1",
75+
"solutionLink": "#",
76+
"problemName": "Number of Diagonals"
77+
},
78+
{
79+
"difficulty": "School",
80+
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-addition1206/1",
81+
"solutionLink": "#",
82+
"problemName": "12 hour clock addition"
83+
},
84+
{
85+
"difficulty": "School",
86+
"gfgLink": "https://www.geeksforgeeks.org/problems/checcheck-if-two-given-circles-touch-each-other5038/1",
87+
"solutionLink": "#",
88+
"problemName": "Check if two given circles touch each other"
89+
},
90+
{
91+
"difficulty": "School",
92+
"gfgLink": "https://www.geeksforgeeks.org/problems/combinational-logic1908/1",
93+
"solutionLink": "#",
94+
"problemName": "Combinational Logic"
95+
},
96+
{
97+
"difficulty": "School",
98+
"gfgLink": "https://www.geeksforgeeks.org/problems/java-abstract-keyword/1",
99+
"solutionLink": "#",
100+
"problemName": "Java Abstract keyword"
101+
},
102+
{
103+
"difficulty": "School",
104+
"gfgLink": "https://www.geeksforgeeks.org/problems/compound-interest0235/1",
105+
"solutionLink": "#",
106+
"problemName": "Compound Interest"
107+
},
108+
{
109+
"difficulty": "School",
110+
"gfgLink": "https://www.geeksforgeeks.org/problems/program-to-print-reciprocal-of-letters36233623/1",
111+
"solutionLink": "#",
112+
"problemName": "Program to print reciprocal of letters"
113+
},
114+
{
115+
"difficulty": "School",
116+
"gfgLink": "https://www.geeksforgeeks.org/problems/determine-focal-length-of-a-spherical-mirror5415/1",
117+
"solutionLink": "#",
118+
"problemName": "Determine focal length of a spherical mirror"
119+
},
120+
{
121+
"difficulty": "School",
122+
"gfgLink": "https://www.geeksforgeeks.org/problems/12-hour-clock-multiplication4709/1",
123+
"solutionLink": "#",
124+
"problemName": "12 hour clock Multiplication "
125+
},
126+
{
127+
"difficulty": "School",
128+
"gfgLink": "https://www.geeksforgeeks.org/problems/number-pattern0517/1",
129+
"solutionLink": "#",
130+
"problemName": "Number Pattern"
131+
},
132+
{
133+
"difficulty": "School",
134+
"gfgLink": "https://www.geeksforgeeks.org/problems/parallel-or-perpendicular4257/1",
135+
"solutionLink": "#",
136+
"problemName": "Parallel or Perpendicular?"
137+
},
138+
{
139+
"difficulty": "School",
140+
"gfgLink": "https://www.geeksforgeeks.org/problems/decimal-to-any-base-conversion2440/1",
141+
"solutionLink": "#",
142+
"problemName": "Decimal to any base conversion"
143+
},
144+
{
145+
"difficulty": "School",
146+
"gfgLink": "https://www.geeksforgeeks.org/problems/time-to-words3728/1",
147+
"solutionLink": "#",
148+
"problemName": "Time to Words"
149+
}
151150
]
152151

153-
<Table
152+
<Table
154153
title=""
155154
data={problems}
156155
isSorted={false}
157156
collectionLink="https://www.geeksforgeeks.org/"
158157
/>
159158

160-
Now, you can see the list of problems in a table format. You can click on the problem link to view the problem on the GeeksforGeeks website. You can also click on the solution link to view the solution of the problem.
159+
Now, you can see the list of problems in a table format. You can click on the problem link to view the problem on the GeeksforGeeks website. You can also click on the solution link to view the solution of the problem.

dsa-problems/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
title: Data Structures and Algorithms Problems
33
sidebar_label: DSA Problems
44
sidebar_position: 1
5-
65
---
76

87
DSA Problems are a collection of problems that are frequently asked in coding interviews. These problems are categorized based on the data structures and algorithms they use. The problems are available in multiple programming languages like C++, Java, Python, and JavaScript. The problems are also available in the form of video tutorials and solutions.
98

10-
119
## What is Data Structures and Algorithms?
1210

1311
Data Structures and Algorithms are the building blocks of computer science. Data structures are a way of organizing and storing data in a computer so that it can be accessed and modified efficiently. Algorithms are a set of instructions that are used to perform a specific task. Data structures and algorithms are used to solve complex problems in computer science and software development.
@@ -49,4 +47,4 @@ You can click on the links above to view the problems in each category. You can
4947

5048
## Conclusion
5149

52-
Data Structures and Algorithms are an important part of computer science and software development. By learning and practicing data structures and algorithms, you can improve your problem-solving skills and become a better programmer. The problems available on this website are a great resource for practicing data structures and algorithms and preparing for coding interviews. I hope you find these problems helpful in your journey of learning data structures and algorithms.
50+
Data Structures and Algorithms are an important part of computer science and software development. By learning and practicing data structures and algorithms, you can improve your problem-solving skills and become a better programmer. The problems available on this website are a great resource for practicing data structures and algorithms and preparing for coding interviews. I hope you find these problems helpful in your journey of learning data structures and algorithms.

dsa-solutions/lc-solutions/0100-0199/0171-excel-sheet-column-number.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ id: excel-sheet-column-number
33
title: Excel Sheet Column Number
44
---
55

6-
76
## Problem Description
87

98
Given a string **columnTitle** that represents the column title as appears in an Excel sheet, return its corresponding column number.
@@ -16,11 +15,10 @@ C -> 3
1615
...
1716
Z -> 26
1817
AA -> 27
19-
AB -> 28
18+
AB -> 28
2019
...
2120
```
2221

23-
2422
### Examples
2523

2624
**Example 1:**
@@ -36,17 +34,17 @@ AB -> 28
3634
## Solution for Best Time to Buy and Sell Stock Problem
3735

3836
### Intuition
37+
3938
The intuition behind the solution is to treat each letter as a digit in a base-26 number system, where 'A' represents 1, 'B' represents 2, ..., 'Z' represents 26. The solution then iterates through each character in the column title, calculates the numeric value of the corresponding letter, and accumulates the result by considering the positional weight of each letter.
4039

4140

4241
- Initialize variables x and ans to keep track of the positional weight and the accumulated result, respectively.
4342
- Iterate through each character s in the columnTitle.
4443
- Convert the character s to its numeric representation by using the ord function (ASCII value) and subtracting 64 (since 'A' corresponds to 65 in ASCII).
45-
- Update the result (ans) by adding the product of the numeric representation, positional weight (26**x), and decrease the positional weight x by 1.
44+
- Update the result (ans) by adding the product of the numeric representation, positional weight (26\*\*x), and decrease the positional weight x by 1.
4645
- Repeat this process for each character in the column title.
4746
- Return the final accumulated result.
4847

49-
5048
### Code in Different languages
5149

5250
#### Code in C++ language
@@ -68,7 +66,7 @@ public:
6866
}
6967
};
7068

71-
69+
7270
```
7371

7472
```python
@@ -83,5 +81,10 @@ class Solution:
8381
x -= 1
8482

8583
return ans
86-
87-
```
84+
85+
```
86+
87+
### Complexity Analysis
88+
89+
- Time complexity: $O(n)$
90+
- Space complexity: $O(1)$

0 commit comments

Comments
 (0)