Coder Social home page Coder Social logo

Comments (2)

das-jishu avatar das-jishu commented on May 18, 2024

Hello, apologies for the confusion but the question indicated that for this scenario, the head of the linked list (both the inputs and output) would point to the least significant digit and so on. 1 -> 4 is actually 41.

Going by your example, 9 -> 9 -> 9 -> 8 -> 9 is actually the number 98999.
Similarly, 1 -> 1-> 1-> 1-> 1 is 11111.
Output is: 0 -> 1 -> 1 -> 0 -> 1 -> 1 which is actually 110110.

This satisfies the desired output where they REQUIRE the least significant digit to appear first. In a case where you want to output the digits as they appear (starting with the most significant digit), reversing the list would make sense. Thanks for pointing it out. I will add a comment at the top so people don't get confused.

from algoexpert-data-structures-algorithms.

apfel-das avatar apfel-das commented on May 18, 2024

Sorry about it, you are totally right under this assumption (reverse lists as input/output). Mea culpa ✋

from algoexpert-data-structures-algorithms.

Related Issues (6)

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.