Search Results

Search found 4 results on 1 pages for 'harshith'.

Page 1/1 | 1 

  • Solving Diophantine Equations Using Python

    - by HARSHITH
    In mathematics, a Diophantine equation (named for Diophantus of Alexandria, a third century Greek mathematician) is a polynomial equation where the variables can only take on integer values. Although you may not realize it, you have seen Diophantine equations before: one of the most famous Diophantine equations is: We are not certain that McDonald's knows about Diophantine equations (actually we doubt that they do), but they use them! McDonald's sells Chicken McNuggets in packages of 6, 9 or 20 McNuggets. Thus, it is possible, for example, to buy exactly 15 McNuggets (with one package of 6 and a second package of 9), but it is not possible to buy exactly 16 nuggets, since no non- negative integer combination of 6's, 9's and 20's adds up to 16. To determine if it is possible to buy exactly n McNuggets, one has to solve a Diophantine equation: find non-negative integer values of a, b, and c, such that 6a + 9b + 20c = n. Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity. Your program should print the answer in the following format (where the correct number is provided in place of n): "Largest number of McNuggets that cannot be bought in exact quantity: n"

    Read the article

  • Career Advice for a Bright Future [closed]

    - by HARSHITH
    I've completed my 12th . Now i am in a big dilemma . Coming to engineering , there are a lot of branches to choose. My elders and mentors suggested me to go for cse . But in this scenario of global meltdown , the cse boom had crushed down drastically . Are there chances for its regrowth . Please reply me with your valuable suggestions so that i can shape my future in a better way . Would you also suggest any other course for me?

    Read the article

  • Playing with Strings

    - by HARSHITH
    Given a string and a non-empty word string, return a string made of each char just before and just after every appearance of the word in the string. Ignore cases where there is no char before or after the word, and a char may be included twice if it is between two words. wordEnds("abcXY123XYijk", "XY") ? "c13i" wordEnds("XY123XY", "XY") ? "13" wordEnds("XY1XY", "XY") ? "11"

    Read the article

1