Coder Social home page Coder Social logo

nikoo28 / java-solutions Goto Github PK

View Code? Open in Web Editor NEW
223.0 6.0 120.0 541 KB

Solutions in JAVA for some coding platforms.

Home Page: https://studyalgorithms.com

License: Apache License 2.0

Java 100.00%
java strings trees dynamic-programming backtracking greedy-algorithms leetcode hackerrank linked-list tutorial education arrays

java-solutions's Introduction

Main Workflow

Follow me on your favorite platform for latest updates on my video channel

Youtube Facebook Twitter Tumblr RSS

You can also subscribe via email.

How to use this repo

Install softwares

  • Install OpenJDK
  • Install Maven
  • Install Git
  • Use your favorite editor. (I prefer IntelliJ. It is fast and free)

Setup Project

  • Goto your desired folder and clone the repository
  • cd into your directory
  • Build the project using mvn clean install.
  • Startup IntelliJ and choose to import this project from your Explorer/Finder window.
  • Start making changes/using it.
[user@machine ~] git clone https://github.com/nikoo28/java-solutions.git
[user@machine ~] cd java-solutions
[user@machine ~/java-solutions] mvn clean install
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------< com.studyalgorithms.javasolutions:java-solutions >----------
[INFO] Building java-solutions 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------

... snipped

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.790 s
[INFO] Finished at: 2020-07-06T18:37:35-07:00
[INFO] ------------------------------------------------------------------------
[user@machine ~/java-solutions]

Contribute

Please contribute to this repository to help it make better. Any change like new questions you want to see, code improvements, doc improvements etc. is very welcome. Just send me a pull request and I will review the request and approve it, if it looks good.

Solutions for some coding platforms

Full list of questions

https://studyalgorithms.com/site-map/

Code Explanations

String

Array

Linked Lists

Trees

Theory

Algorithmic Paradigms

Analysis of Algorithms

Sorting Techniques

Searching Techniques

Data Structures

Playlists

java-solutions's People

Contributors

nikoo28 avatar nlohia-godaddy avatar gouthamguna avatar khemanthraju avatar jayambe36 avatar dependabot[bot] avatar

Stargazers

 avatar Reevan Chris avatar  avatar VIDHEESH KUMAR KASANAGOTTU avatar azharr avatar  avatar  avatar  avatar Rana Sarkar avatar Chandra G avatar MadhanLal T J avatar M0N1SH avatar Mohammad Bashar Afzal avatar Mochammad Fatchur Rochman avatar Amit Dnyandeo Haral avatar Dakshina Prasath M avatar Harshita Singh avatar Tarun M S avatar  avatar Priti Saha avatar  avatar Odair Vaz avatar SWASTIK SINGHA ROY avatar  avatar  avatar Lidiya avatar Priyansu Sahoo avatar Java Boot Programmer avatar Anil Kumar avatar MAhamed avatar Nishtha Pandey avatar Abbas Muzammil avatar Irusha avatar  avatar Abhay avatar Sibashish Biswas avatar Harshal avatar  avatar Abhilash avatar  avatar Sabir avatar  avatar Chandra Mukherjee avatar Priyanka Lashkari avatar Chirag singh avatar Khyati Choudhary avatar HRRhere avatar Girish  avatar mshd3 techs avatar Ajay Kumar avatar ayoub bouagna  avatar Tojas Bharambe avatar Rutvikraj Rathod avatar Saurabh Chakrabarthi avatar Abdenassar Amimi avatar SHUBHOJEET5 avatar Deepak Katariya avatar  avatar nehay5526 avatar Khin Thandar Kyaw avatar Rutvik Kulkarni avatar akansha_05 avatar Rajesh Pasupuleti avatar Avanish Kumar avatar Abhijit Shaw avatar  avatar Himanshu Kumar (Yadav) avatar Abhishek Dubey avatar Negin Mahrang avatar  avatar  avatar Muhammad Azeem avatar  avatar Shinas Najeer Koya avatar  avatar  avatar  avatar Manoj Kumar  avatar Prithvi Raj avatar Naina Mogha avatar AtharvRaoRege avatar Amogh  avatar Asish Kumar Barik avatar  avatar Priyal Chawla avatar  avatar  avatar Rana Banerjee avatar Depinder Kaur avatar SKumar avatar Vimalraj avatar Taketoday avatar AzyShu  avatar Ameyaa Biwalkar avatar  avatar adityasenapati avatar Devak Mistry avatar dineshkp-dev avatar David Clerc avatar Sujaygouda R Patil avatar

Watchers

 avatar Ishan Nachiketa avatar  avatar  avatar  avatar Aditi Kaushik avatar

java-solutions's Issues

FindTheDuplicateNumber

Hi Nikhil,
Thank you very much for the amazing videos on youtube and code in GitHub! It helps a lot to learn and solve algorithms. I need clarification on the solution provided for FindTheDuplicateNumber.java

If we try to access the index based on the values, wouldn't it throw the ArrayIndexOutOfBounds exception when the number is large? For example, the size of the input { 101, 324, 122, 15, 46, 39, 324, 131, 41, 324} is 9 but the values are much larger.

I don't know if there is an assumption where the values are within index.

Odd Even Linked List

Question

your answer

I can't understand about how the head returns the value.

image

Here, odd variable's value is assigned as head. But , how the head returns the answer ?

For example :

image

I assigned the value of "a" as 3 and "b" as "a". If I change the value of b. the value of "b" only changes .

But , how you returned the head as answer ?3

could you please answer me ?

Not accepted in leetCode

According to leet code, the following test case does not pass with the following question

[[1,1,0,0,1,0,0,1,1,0],[1,0,0,1,0,1,1,1,1,1],[1,1,1,0,0,1,1,1,1,0],[0,1,1,1,0,1,1,1,1,1],[0,0,1,1,1,1,1,1,1,0],[1,1,1,1,1,1,0,1,1,1],[0,1,1,1,1,1,1,0,0,1],[1,1,1,1,1,0,0,1,1,1],[0,1,0,1,1,0,1,1,1,1],[1,1,1,0,1,0,1,1,1,1]]

the required output should be:

[[2,1,0,0,1,0,0,1,1,0],[1,0,0,1,0,1,1,2,2,1],[1,1,1,0,0,1,2,2,1,0],[0,1,2,1,0,1,2,3,2,1],[0,0,1,2,1,2,1,2,1,0],[1,1,2,3,2,1,0,1,1,1],[0,1,2,3,2,1,1,0,0,1],[1,2,1,2,1,0,0,1,1,2],[0,1,0,1,1,0,1,2,2,3],[1,2,1,0,1,0,1,2,3,4]]

but our output is :

[[-2147483647,-2147483648,0,0,1,0,0,-2147483634,-2147483633,0],[-2147483648,0,0,1,0,-2147483637,-2147483636,-2147483635,-2147483634,1],[-2147483647,-2147483646,-2147483645,0,0,-2147483638,-2147483637,-2147483636,-2147483635,0],[0,-2147483645,-2147483644,-2147483643,0,-2147483639,-2147483638,-2147483637,-2147483636,1],[0,0,-2147483643,-2147483642,-2147483641,-2147483640,-2147483639,-2147483638,-2147483637,0],[-2147483640,-2147483641,-2147483642,-2147483641,-2147483640,-2147483639,0,-2147483637,-2147483636,-2147483635],[0,-2147483640,-2147483641,-2147483640,-2147483639,-2147483638,-2147483637,0,0,-2147483634],[-2147483638,-2147483639,-2147483640,-2147483639,-2147483638,0,0,-2147483631,-2147483632,-2147483633],[0,1,0,-2147483638,-2147483637,0,-2147483629,-2147483630,-2147483631,-2147483632],[1,2,1,0,-2147483636,0,-2147483628,-2147483629,-2147483630,-2147483631]]

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.