Skip to content
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

Added two Hackerrank programs 1. Designer Door Mat 2. String Split and Join #31

Merged
merged 4 commits into from
Oct 6, 2020

Conversation

fharookshaik
Copy link
Contributor

@fharookshaik fharookshaik commented Oct 4, 2020

Hackerank Questions.

  1. Designer Door mat

                   Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following 
                   specifications:
    
                 Mat size must be X. ( is an odd natural number, and  is  times .)
                 The design should have 'WELCOME' written in the center.
                 The design pattern should only use |, . and - characters.
                  Sample Designs
    
                           Size: 7 x 21 
                                ---------.|.---------
                                 ------.|..|..|.------
                                   ---.|..|..|..|..|.---
                             -------WELCOME-------
                                   ---.|..|..|..|..|.---
                                 ------.|..|..|.------
                               ---------.|.---------
    
                         Size: 11 x 33
                        ---------------.|.---------------
                          ------------.|..|..|.------------
                            ---------.|..|..|..|..|.---------
                             ------.|..|..|..|..|..|..|.------
                              ---.|..|..|..|..|..|..|..|..|.---
                  -------------WELCOME-------------
                              ---.|..|..|..|..|..|..|..|..|.---
                            ------.|..|..|..|..|..|..|.------
                          ---------.|..|..|..|..|.---------
                        ------------.|..|..|.------------
                      ---------------.|.---------------
               Input Format
    
                   A single line containing the space separated values of  and .
                  Constraints
    
            Output Format
    
                        Output the design pattern.
    
             Sample Input
    
                              9 27
           Sample Output
    
                   ------------.|.------------
                     ---------.|..|..|.---------
                       ------.|..|..|..|..|.------
                         ---.|..|..|..|..|..|..|.---
               ----------WELCOME----------
                        ---.|..|..|..|..|..|..|.---
                      ------.|..|..|..|..|.------
                    ---------.|..|..|.---------
                  ------------.|.------------
    

2.String Split and Join

     In Python, a string can be split on a delimiter.

      Example:

        >>> a = "this is a string"
        >>> a = a.split(" ") # a is converted to a list of strings. 
        >>> print a
        ['this', 'is', 'a', 'string']
        Joining a string is simple:

        >>> a = "-".join(a)
        >>> print a
       this-is-a-string 
       Task
       You are given a string. Split the string on a " " (space) delimiter and join using a - hyphen.

        Input Format
        The first line contains a string consisting of space separated words.

       Output Format
       Print the formatted string as explained above.

      Sample Input

                              this is a string   
                              
      Sample Output

                             this-is-a-string

Hi,

I'm Shaik Fharook. I've added two more solved hacker rank programs under python folder

Please find them and feel free to contact me if any problem occurs.

Thank You

@fharookshaik
Copy link
Contributor Author

Looks like there's an error while creating a PR. And I see everyone is facing the same issue. Please resolve it soon @swapnanildutta

@fharookshaik
Copy link
Contributor Author

The codes I've published are rechecked and working fine for all the test cases. I'm getting the PR error. Please resolve it @swapnanildutta .

@swapnanildutta
Copy link
Owner

That's not important, I'll check the PR and merge it. Thanks and keep contributing.

@fharookshaik
Copy link
Contributor Author

Oh! Alright. Thanks @swapnanildutta

Copy link
Owner

@swapnanildutta swapnanildutta left a comment

Choose a reason for hiding this comment

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

Please add the HackerRank Question on top as comment. Thank you.

@fharookshaik fharookshaik changed the title Added two programs 1. Designer Door Mat 2. String Split and Join Added two Hackerrank programs 1. Designer Door Mat 2. String Split and Join Oct 5, 2020
@fharookshaik
Copy link
Contributor Author

Hey @swapnanildutta I've made changes as you requested. Please review them and report me if you need any other changes.

Thank You

@fharookshaik
Copy link
Contributor Author

Hey @swapnanildutta . I've made all the changes that you've requested. Please approve my PR.

@swapnanildutta
Copy link
Owner

Where is the change?

@fharookshaik
Copy link
Contributor Author

You've asked to add the names of the hacker-rank programs to the first comment and I've done that. Please check the title and the first comment and I'm attaching the screenshot as a reference. Feel free to comment on this issue and I'm ready to resolve them as soon as possible.

Thank You
Screenshot 2020-10-05 221156

@swapnanildutta
Copy link
Owner

I asked for the entire question as a comment in the file where the code is present.

@fharookshaik
Copy link
Contributor Author

Oh! Got it. I'll post them in a minute. Please find them.

Thank You

@fharookshaik
Copy link
Contributor Author

Added the questions. Review my PR.

Thank You

@swapnanildutta
Copy link
Owner

Please commit your changes.

@fharookshaik
Copy link
Contributor Author

I've Committed.

@swapnanildutta
Copy link
Owner

Please check the other already existing codes before committing.

@fharookshaik
Copy link
Contributor Author

okay got it. Some one else have committed one of the programs that i've written. No issues. I'll commit another PR, with the new one.
Does it sounds good?

@fharookshaik
Copy link
Contributor Author

Commited bro.

@fharookshaik
Copy link
Contributor Author

Looks like the labeler is giving an error every time. Is there anything that I've to concern about that?

@swapnanildutta swapnanildutta merged commit 625ded2 into swapnanildutta:master Oct 6, 2020
@fharookshaik
Copy link
Contributor Author

Hey, Thanks for accepting the PR. Add the 'hacktoberfest-accepted' label to the PR as it is mandatory as per new rules of hacktoberfest.

Thank You.

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.

2 participants