Comments (4)
Hi @mr-robot77, can you also specific which algorithm is giving wrong output along with
- inputs
- expected output
- incorrect output.
from courses-project.
in the python ch2 string folder
returner program has an issue in runtime output
this program is about a safe with k rotating locks with a sequence of numbers from 1 to 9 and our mission is finding to k-digit code from input and in the output should give the minimum number of rotation of the wheels for the number to be equal to the code.
if we get this input:
3 123 241356789 987546231 956874231
our expected output should be this:
7
but because of something is missing in define of algorithm of this problem, so we get this wrong output:
2148921431256
from courses-project.
Hey,
- I not able to understand what you are trying to achieve
- The code implies that locks is a list of sub lists but the input provided is unclear about how many elements goes in each iteration
Eg.
k = 3
code = 123
for k = 1
input can be 241356789
OR
input can be 241356789 987546231
OR
input can be 241356789 987546231 956874231
Therefore, please provide an input separated by new line
- if number in locks[i]: will always result in False since it's checking if 1 is an element in a sub list and this is never the case
Therefore, my answer in always 0
from courses-project.
i solved the issues and change the code
now it's worked correctly
from courses-project.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from courses-project.