You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: dsa-problems/index.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,10 @@
2
2
title: Data Structures and Algorithms Problems
3
3
sidebar_label: DSA Problems
4
4
sidebar_position: 1
5
-
6
5
---
7
6
8
7
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.
9
8
10
-
11
9
## What is Data Structures and Algorithms?
12
10
13
11
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
49
47
50
48
## Conclusion
51
49
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.
Copy file name to clipboardExpand all lines: dsa-solutions/lc-solutions/0100-0199/0171-excel-sheet-column-number.md
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@ tags:
9
9
description: "This is a solution to the Excel Sheet Column Number on LeetCode."
10
10
---
11
11
12
-
13
12
## Problem Description
14
13
15
14
Given a string **columnTitle** that represents the column title as appears in an Excel sheet, return its corresponding column number.
@@ -22,11 +21,10 @@ C -> 3
22
21
...
23
22
Z -> 26
24
23
AA -> 27
25
-
AB -> 28
24
+
AB -> 28
26
25
...
27
26
```
28
27
29
-
30
28
### Examples
31
29
32
30
**Example 1:**
@@ -54,18 +52,18 @@ AB -> 28
54
52
## Solution for Best Time to Buy and Sell Stock Problem
55
53
56
54
### Intuition
55
+
57
56
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.
58
57
59
58
### Approach
60
59
61
60
- Initialize variables x and ans to keep track of the positional weight and the accumulated result, respectively.
62
61
- Iterate through each character s in the columnTitle.
63
62
- 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).
64
-
- Update the result (ans) by adding the product of the numeric representation, positional weight (26**x), and decrease the positional weight x by 1.
63
+
- Update the result (ans) by adding the product of the numeric representation, positional weight (26\*\*x), and decrease the positional weight x by 1.
65
64
- Repeat this process for each character in the column title.
0 commit comments