Skip to content

All easy gfg solution added #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Vipullakum007
Copy link
Contributor

Related Issue

fixed : #386

Description

i have added solution for all easy problems
i have added 10 files for solution of 10 problems

Screenshot 2024-06-05 221647

Type of PR

  • Bug fix
  • Feature enhancement
  • Documentation update
  • Other (specify): _______________

Screenshots / Videos (if applicable)

Screenshot (677)

Screenshot (678)

Screenshot (679)

Screenshot (680)

Screenshot (681)

Screenshot (682)

Screenshot (683)

Screenshot (684)

Screenshot (685)

Screenshot (686)

Checklist

  • I have performed a self-review of my code.
  • I have read and followed the Contribution Guidelines.
  • I have tested the changes thoroughly before submitting this pull request.
  • I have provided relevant issue numbers, screenshots, and videos after making the changes.
  • I have commented my code, particularly in hard-to-understand areas.

Additional Context

[Include any additional information or context that might be helpful for reviewers.]

Resources for Guidance

Here are some resources that may be helpful as you contribute to CodeHarborHub:

Resources for DSA Features on Our Site:

Copy link
Contributor

deepsource-io bot commented Jun 5, 2024

Here's the code health analysis summary for commits 0e0621f..a934c18. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@Vipullakum007
Copy link
Contributor Author

hey @ajay-dhangar , please make itlevel 3because i have added solution for all easy problems of gfg there are 10 problem i have added 10 solution

@ajay-dhangar ajay-dhangar added documentation Improvements or additions to documentation GSSOC'24 GirlScript Summer of Code | Contributor level2 GirlScript Summer of Code | Contributor's Levels gssoc GirlScript Summer of Code | Contributor labels Jun 5, 2024
@ajay-dhangar
Copy link
Member

hey @ajay-dhangar , please make itlevel 3because i have added solution for all easy problems of gfg there are 10 problem i have added 10 solution

@Vipullakum007 I prefer quality over quantity. I don't need multiple files or folders . You can work on a single file that I assign, possibly at level 3, but ensure it is done professionally. Please make sure your content is clear, well-structured, and thoroughly explained.

Copy link
Member

@ajay-dhangar ajay-dhangar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now update code for all files based on suggestions


### Constraints
- 1 ≤ N ≤ 10^5
- -10^3 ≤ arr[i] ≤ 10^3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace

- 1 ≤ N ≤ 10^5  
- -10^3 ≤ arr[i] ≤ 10^3

to

- $1 ≤ N ≤ 10^5$
- $-10^3 ≤ arr[i] ≤ 10^3$

**Expected Auxiliary Space:** O(Number of distinct characters)

### Constraints
- 1 ≤ |str|,|patt| ≤ 10^5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace

- 1 ≤ |str|,|patt| ≤ 10^5
- 'a' ≤ str[i], patt[i] ≤ 'z'

to

- $1 ≤ |str|,|patt| ≤ 10^5$
- $'a' ≤ str[i], patt[i] ≤ 'z'$


### Complexity Analysis

- **Time Complexity:** O(N), where N is the length of the string `str`. We iterate through each character in `patt` and use the `find` or `indexOf` method, which runs in O(N) time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace O(N) to $O(N)$ and O(1) to $O(1)$


You don't need to read input or print anything. Your task is to complete the function `bfsOfGraph()` which takes the integer `V` denoting the number of vertices and adjacency list as input parameters and returns a list containing the BFS traversal of the graph starting from the 0th vertex from left to right.

**Expected Time Complexity:** O(V + E)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace O(V + E) to $O(V + E)$ and O(V) to $O(V)$


The provided solutions efficiently perform a Breadth First Search (BFS) traversal of a directed graph. By starting from the 0th vertex and using a queue to manage the traversal, the algorithms ensure that all reachable vertices are visited in the correct order. The solutions operate in O(V + E) time and use O(V) space complexity, where V and E are the numbers of vertices and edges in the graph, respectively.

**Time Complexity:** O(V + E)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace

O(V + E) $=>$ $O(V + E)$
O(V) $=>$ $O(V)$

**Expected Auxiliary Space:** O(1)

**Constraints**
- 1 ≤ x ≤ 10^7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace 1 ≤ x ≤ 10^7 to $1 ≤ x ≤ 10^7$


You don't need to read input or print anything. The task is to complete the function `floorSqrt()` which takes `x` as the input parameter and returns its square root. Note: Try solving the question without using the sqrt function. The value of `x` ≥ 0.

**Expected Time Complexity:** O(log N)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace O(log N) to $O(log N)$ and O(1) to $O(1)$

### Complexity Analysis

- **Time Complexity:** O(N), where N is the number of nodes in the linked list. We traverse the entire list once.
- **Space Complexity:** O(1), as we only use a constant amount of extra space for pointers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace O(1) to $O(1)$ and O(N) to $O(N)$

**Expected Auxiliary Space:** O(1)

### Constraints
1 ≤ N ≤ 10^4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad practice

### Constraints
1 ≤ N ≤ 10^4

Good practice

### Constraints

- $1 ≤ N ≤ 10^4$

### Your Task
The task is to complete the function `reverseList()` with head reference as the only argument and should return the new head after reversing the list.

**Expected Time Complexity:** O(N)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace O(N) to $O(N)$
and O(1) to $O(1)$

@Vipullakum007
Copy link
Contributor Author

hey @ajay-dhangar , please make itlevel 3because i have added solution for all easy problems of gfg there are 10 problem i have added 10 solution

@Vipullakum007 I prefer quality over quantity. I don't need multiple files or folders . You can work on a single file that I assign, possibly at level 3, but ensure it is done professionally. Please make sure your content is clear, well-structured, and thoroughly explained.

please can you point out what you want so that i can better / i can make professionally
i have ask this question many times please answer me.

@Vipullakum007
Copy link
Contributor Author

hey @ajay-dhangar , please make itlevel 3because i have added solution for all easy problems of gfg there are 10 problem i have added 10 solution

@Vipullakum007 I prefer quality over quantity. I don't need multiple files or folders . You can work on a single file that I assign, possibly at level 3, but ensure it is done professionally. Please make sure your content is clear, well-structured, and thoroughly explained.

please can you point out what you want so that i can better / i can make professionally i have ask this question many times please answer me.

hey @ajay-dhangar , updated as per your suggestion , you can review it. please answer

@ajay-dhangar
Copy link
Member

hey @ajay-dhangar , please make itlevel 3because i have added solution for all easy problems of gfg there are 10 problem i have added 10 solution

@Vipullakum007 I prefer quality over quantity. I don't need multiple files or folders . You can work on a single file that I assign, possibly at level 3, but ensure it is done professionally. Please make sure your content is clear, well-structured, and thoroughly explained.

please can you point out what you want so that i can better / i can make professionally i have ask this question many times please answer me.

Yah sure,
I review your work then may be assign good level if your contents is good and fully based on our structures

Copy link
Member

@ajay-dhangar ajay-dhangar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update your code based on suggestions and can't be use space for maths expression. And review all files code and resolve issues

**Expected Auxiliary Space:** $O(V)$

**Constraints**
- $ 1 ≤ V, E ≤ 10^4 $
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace - $ 1 ≤ V, E ≤ 10^4 $ to - $1 ≤ V, E ≤ 10^4$

Copy link

sonarqubecloud bot commented Jun 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@Vipullakum007
Copy link
Contributor Author

hey @ajay-dhangar ,updated as per your suggestion

Copy link
Member

@ajay-dhangar ajay-dhangar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ajay-dhangar ajay-dhangar merged commit 6fb7783 into codeharborhub:main Jun 6, 2024
6 checks passed
@sanjay-kv sanjay-kv removed the level2 GirlScript Summer of Code | Contributor's Levels label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation gssoc GirlScript Summer of Code | Contributor GSSOC'24 GirlScript Summer of Code | Contributor
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature Request]: i want to add solution of all easy problems
3 participants