Coder Social home page Coder Social logo

nikoo28 / java-solutions Goto Github PK

View Code? Open in Web Editor NEW
300.0 6.0 146.0 582 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

Playlists

java-solutions's People

Contributors

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

Stargazers

Erol Koçoğlu avatar Satish yadav avatar someone avatar Padmapriya Vijayaragava Rengaraj avatar Parth Srivastava avatar Dibyajyoti Das avatar  avatar Jeevan M Swamy avatar Likith V Shetty avatar Harsha.I avatar Vishwajeet Singh avatar Kartik Sharma avatar Ravi Nagubandi avatar Arnav avatar Parthi Gadher avatar Pittala Akshath Sai avatar  avatar Praveen Kumar avatar  avatar Milinda Barua avatar purnachand99 avatar Yaseen N S B.Nagara avatar Rupesh M avatar Lavesh Patil avatar Gunisetti Gokul avatar Mani Babu Miriyala avatar  avatar  avatar Rupesh Kumar avatar Jahnavi Gundakaram avatar Nader Mohamed Nader avatar Anshu Sharma avatar Shaik Khaja Sharif avatar  avatar M Yusuf AGABEYOGLU avatar  avatar RAVI KIRAN EEDUPUGANTI  avatar Jahnavi Gundakaram avatar Soyeon avatar ysc avatar  avatar Triet Trinh avatar Suchir Vohra avatar  avatar AKSHITHA G avatar  avatar  avatar RITESH YADAV avatar Shivangi Singh avatar Nitesh Kumar avatar Gianna avatar  avatar Rahul Kumar avatar A Madan avatar  avatar Hardik avatar Edward Samuel L avatar  avatar Rhythm Choudhary avatar AG avatar Omkar avatar M Khadar Basha Jilan avatar  avatar  avatar Vanshika Sharma avatar Nikhil Kumar avatar  avatar Alfredo C. avatar Priyansh Singhal avatar Nikhil Kumar Singh avatar Zephyrus avatar Nguyễn Lê Nhật Huy avatar aman_21 avatar Deepakkumar V avatar Shital Patle avatar KiraVendanta avatar  avatar Nisha Tiwari avatar Istiyak Milon avatar Vladimir Brkic avatar AbdulHadi  avatar Saksham Jain avatar  avatar Reevan Chris avatar  avatar VIDHEESH KUMAR KASANAGOTTU avatar dawood avatar  avatar Anirban Dutta avatar  avatar Rana Sarkar avatar Chandra G avatar MadhanLal T J avatar Mohammad Bashar Afzal avatar Mochammad Fatchur Rochman avatar Amit Dnyandeo Haral avatar Dakshina Prasath M avatar Tarun M S avatar  avatar Priti Saha avatar

Watchers

 avatar Luke Avedon avatar Ishan Nachiketa 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.

  • 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.