473,597 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Number with greatest product of digits between two given numbers

1 New Member
How do I find a number between two given numbers (let's call them min and max), which has the greatest product of digits than any other number in that range? (If there are several such numbers, that's fine.)

For example:
+ min = 390, max = 430 => answer is 399
+ min = 400, max = 430 => answer is 429
+ min = 1378, max = 1594 => answer is 1589 (this one is not as obvious as previous, because 1499 is not the one)

The problem is that min and max can be really huge - up to 10^10000, therefore I can just iterate through the range and find the answer.

Please explain the algorithm. Preferrably Java.
Jan 13 '19 #1
0 3524

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1171
by: Chris Michael | last post by:
I've got a string of numbers, say 123456 (the actually number is 12 digits long). I need to calculate the sum of each individual number in the string of numbers, so in the example of 123456 the sum would be 21 (1+2+3+4+5+6). Thanks
2
2068
by: Shannon Scheer | last post by:
Hi i am converting some data in our POS System which currently uses 13 digits for UPC codes (eg 0000000001234) however our Barcode software requires the UPC to be 12 digits (000000001234) I would like to run a querie that can take all of the current UPC's in our system and place them in a new table with the extra zero removed from the front of the upc. How can I do this the easiest? My tables are as follows Products (tablename)
1
1929
by: Wally | last post by:
I am after VB.net code for a random number generator that will generate 10 different numbers between 1 and 10 and put them into an array. For example I want the output to be something like 10,7,8,6,9,4,5,2,3,1. Can anyone provide me with the code? Thanks,
14
9105
by: RonHouston | last post by:
Hi, I was wondering if someone could help me on this one. Is there anyway to format a string/integer etc so that it always outputs a 4 digits number? thank you. Ron.
7
1752
by: cess | last post by:
Hi!!! i would like to know if what is lacking in the codes below to have a greatest common denominator of two given(by the user) numbers?? I'm confused and i need your help! import java.io.*; public class gcd { public static void main (String args)throws Exception { String number;
7
4322
by: Deviate | last post by:
Hi guys :) I'm writing this program that enabls the user to choose a number of observations, from the normal distribution. I.e. Lets say the user chooses 100 observations, then the program will generate 100 random numbers from the normal distribution. My problem is that i have 10 known intervals, and i have to enable the program to count how many of the 100 observations fall in each interval. I dont know how to do this, i havent learnt using...
6
2104
by: sarfraznawaz | last post by:
Hi, I am Web Designer. I am new to this coding related job. Can anyone help me how to sort this out. How to calculate number of words with given price? Thanks. Sarfraz
6
12905
by: kevow123 | last post by:
If i had the number 123 how would i make it 321?
0
7884
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8024
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6681
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.