Skip to content

Creating a JS file for solving-pascals tringle. #1312

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
merged 3 commits into from
Nov 2, 2022

Conversation

aadil42
Copy link
Contributor

@aadil42 aadil42 commented Oct 23, 2022

Solved pascals-triangle in JS.
@aadil42
Copy link
Contributor Author

aadil42 commented Oct 23, 2022

Hey, @voski Please tell me if I did it right this time.

@voski
Copy link
Contributor

voski commented Oct 23, 2022

Hey, @voski Please tell me if I did it right this time.

@aadil42 This pull request is #1312

The very first comment is the description of a pull request. In this case, it is #1312 (comment)

I am quoting the description below. Does it look right to you? The files modified section is wrong, the language section is wrong, and the submission URL is not filled in again.

Solved pascals-triangle in JS.
File(s) Modified: 1-Two-Sum.py, 2-Add-Two-Numbers.py, etc...
Language(s) Used: python, javascript, etc...
Submission URL: https://leetcode.com/submissions/detail/xxxxxxxxx/

Take a look at this other pull request #1309 The description is updated to reflect the actual changes. Here is the description from #1309

You can see that the files modified section is updated to reflect the file in the pull request 0146-LRU-Cache.rb. Also, the language section is updated to the correct language ruby. And finally, the submission URL is updated and you can follow that link to see the results on leetcode.

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 24, 2022

@voski I'm so sorry. I am new to contributing to repos. I really apologize for the confusion. I updated the description of a PR. Please check and let me know if it's right this time. I am so sorry and Thank you for explaining.

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 25, 2022

Hey @voski, Did I do it wrong again? please let me know. Thank you

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 26, 2022

Hey @voski, my PR hasn't been merged yet so this is just a kind reminder. Let me know if I need to do anything.

@voski
Copy link
Contributor

voski commented Oct 26, 2022

Hey @voski, my PR hasn't been merged yet so this is just a kind reminder. Let me know if I need to do anything.

Hello there. I actually don’t have merge permissions on this repo. I’m just another contributor like you.

@dissesmac
Copy link
Collaborator

dissesmac commented Oct 27, 2022

I think you can do it without checking if size > 2

Just I don't write on JS. I can share my solution on Swift.
It would be less code and more understandable.

class Solution {
 func generate(_ numRows: Int) -> [[Int]] {
    var result = [[Int]](repeating: [1], count: numRows)
    for i in 1..<numRows {
        result[i] = [Int](repeating: 1, count: i + 1)
        for j in 1 ..< i {
            result[i][j] = result[i-1][j-1] + result[i-1][j] 
        } 
    }
    return result
 }
}

I don't know why GitHub formats my code in this view.
Link on submission.

https://leetcode.com/problems/pascals-triangle/submissions/831121961/

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 27, 2022

@diss1993 I'll look into your solution soon. Thanks for sharing.

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 31, 2022

@voski I thought you had merge permission. Anyway, thank you for your support and advice on how to make a proper PR. Thanks, huge thank you!

@aadil42
Copy link
Contributor Author

aadil42 commented Oct 31, 2022

@voski btw, I know you don't have merge permission. But is my PR ok? I just wanted to ask to make sure. Thank you again!

@voski
Copy link
Contributor

voski commented Oct 31, 2022

@aadil42

I can't speak to your solution code. I haven't been working with JS much lately and I just don't have the time to get into it.

As far as your PR description it is a lot better. However, the PR template has a bullet list, with bold text, and some italic text. In this submission, you have removed all the formatting.

The content is good but the styling is lost!

@aadil42
Copy link
Contributor Author

aadil42 commented Nov 1, 2022

@voski Thank you, brother! I fixed the formatting. I didn't what text to make italics so left it. but I did the bullet points.

@Ahmad-A0
Copy link
Collaborator

Ahmad-A0 commented Nov 2, 2022

Thanks for contributing (and collaborating)!

@Ahmad-A0 Ahmad-A0 merged commit 0245ee5 into neetcode-gh:main Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy