Giter Site home page Giter Site logo

riju02 / 30-days-of-code-hackerrank Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adityaseth777/30-days-of-code-hackerrank

1.0 0.0 0.0 57 KB

This repository contains the codes, I have been submitting in the 30 Days of Code program by Hackerrank.

License: MIT License

Shell 0.08% Ruby 14.97% C++ 23.95% Python 15.96% C 25.71% Kotlin 19.34%

30-days-of-code-hackerrank's Introduction

This repository contains the codes, I have been submitting in the 30 Days of Code program by Hackerrank.

I have mainly included the codes in the languages I know and am comfortable in. The languages are mainly -> C, C++, Python, Ruby and Kotlin. I am currently solving this event. Source code of the programs solved so far have been uploaded. I will upload the remaining programs as and when I solve. Descriptions and logic of individual programs will be uploaded soon.

1. How to install and run C/C++ ?

Installation ->

  1. Create a C/C++ virtual environment.
  2. Clone the repo git clone https://github.com/AdityaSeth777/30-Days-of-Code-Hackerrank.git or download the repository.
  3. Go to the cloned/downloaded directory, and navigate to your desired program -> cd "folder_name", and then to the code file.
  4. Run pip3 install gcc.
  5. And now you can run the example scripts or create your own scripts.

Usage ->

  • To run any program (without <math.h>), run gcc filename.c -o name, where filename is the name of the file you are wanting to execute; name = output executable file.

  • Then type ./name, and then press Enter to execute successfully.

  • To run any program (with <math.h>), run gcc filename.c -lm, where filename is the name of the file you are wanting to execute.

  • Then type ./a.out, and then press Enter to execute successfully.

2. How to install and run python ?

Installation ->

  1. Create a python virtual environment.
  2. Clone the repo git clone https://github.com/AdityaSeth777/30-Days-of-Code-Hackerrank.git or download the repository.
  3. Go to the cloned/downloaded directory, and navigate to your desired program -> cd "folder_name", and then to the code file.
  4. Go to the Python website.
  5. Download the software.
  6. Install it according to the guide.
  7. Open terminal and type python --version to see whether it is properly installed or not.
  8. And now you can run the example scripts or create your own scripts.

Usage ->

  • To run any python program, run python filename.py, where filename is the name of the file you are wanting to execute.
  • If the above command doesn't work, then run python3 filename.py, where again filename is the name of the file you are wanting to execute.

3. How to install and run Kotlin (basic codes like these) ?

Installation ->

  1. Create a Kotlin virtual environment.
  2. Clone the repo git clone https://github.com/AdityaSeth777/30-Days-of-Code-Hackerrank.git or download the repository.
  3. Go to the cloned/downloaded directory, and navigate to your desired program -> cd "folder_name", and then to the code file.
  4. An easier way to install Kotlin on UNIX-based systems, such as macOS, Linux, Cygwin, FreeBSD, and Solaris, is SDKMAN!. It also works in Bash and ZSH shells. To install the Kotlin compiler via SDKMAN!, run the following command in the terminal: sdk install kotlin.
  5. Alternatively, if you use Snap on Ubuntu, then sudo snap install --classic kotlin is a great method.
  6. And now you can run the example scripts or create your own scripts.

Usage ->

  • To run any Kotlin program, run kotlinc filename.kt -include-runtime -d out.jar, where filename is the name of the file you are wanting to execute ; out = output executable file.
  • Then run, java -jar hello.jar.

4. How to install and run Ruby ?

Installation ->

  1. Create a Ruby virtual environment.
  2. Clone the repo git clone https://github.com/AdityaSeth777/30-Days-of-Code-Hackerrank.git or download the repository.
  3. Go to the cloned/downloaded directory, and navigate to your desired program -> cd "folder_name", and then to the code file.
  4. Go to the installer website, which will give us some ease in installing Ruby. Notice that the list of options has “with Devkit” and “without Devkit” sections. The Devkit versions install the MSYS2 system, which will be required if you need to install RubyGems that require compilation. If you’re just going to play around with plain old Ruby, you might be able to get away with the non-Devkit version
  5. And if you have Ubuntu (Linux), then run the following commands ->
    • sudo apt-get update
    • sudo apt install ruby-full
    • Once the installation is complete, verify it by running this : ruby --version.

Usage ->

  • To run any Ruby program, run ruby your_program.rb.
  • Else if this throws any problem, then :
    • start your program with #!/usr/bin/env ruby.
    • make your file executable by running chmod +x your_program.rb.
    • Run ./your_program.rb some_param.

FAQ

  • How to stop the script? Ctrl+C (control+C for Mac)
  • For any other problems, feel free to raise an issue.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT License © Aditya Seth

What next ?

  • I will be working on completing this wonderful bunch of programs by Hackerrank, which I will be uploading as well.
  • Along with that, I will be uploading other programs as well including my college assignments and other projects.

Where to contact ?

Contact: [[email protected]]

🙋‍♂️ Support

💙 If you like this project, give it a ⭐ and share it with friends!

☕ Buy me a coffee


Made with ❤️ and C, C++, Python, Ruby, and Kotlin.

30-days-of-code-hackerrank's People

Contributors

adityaseth777 avatar

Stargazers

RITAM MUKHOPADHYAY avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.