Giter VIP home page Giter VIP logo

codility's Issues

Suggestion for GenomicSequence improvement

"What is the minimal impact factor of nucleotides contained in a particular part of the given DNA sequence?"

Not sure if my thinking is right, but answer is:

  1. If it contains atleast one A then 1.
  2. If it contains atleast one B then 2. and so on.

If we have an array of counts of size 'A'-'Z' (26) and another array where we get impacts also in 0(1) time then task can be completed in O(m) were m is length of DNA sqeuence

Solution for MaxProductOfThree Wrong

Hi, looks like your code gives %100 results on the codility test cases. But there is a mistake.

Let's say our input is that :

vector vec = {-2, -1, 0 , 4};

According to your code, function returns 0 because of this line :

if ( A[2] == 0 ) return A[0] * A[1] * A[2];

i think , it should be something like this

if ( A[2] == 0 ) return A[0] * A[1] * A[3];

it gives 8.

Such a test scenario may not have come across on the Codility site.

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.