How do i find a two-digits number inside an integer ?

for example how can i know if the number 53 is appers at a specific number like: 53488 or 153222 without usings chars, strings or arrays (maybe something with binary numbers)

What about this?
public class NumberExists {
     private static boolean numExists(int number, int numToFind) {
          int div = (int)Math.pow(10, Math.floor(Math.log(numToFind)/Math.log(10))+1);
          while(number > div) {
               if (((number - numToFind) % div) == 0) return true;
               number /= 10;
          return false;
     public static void main(String[] args) {
          int number = Integer.parseInt(args[0]);
          int numToFind = Integer.parseInt(args[1]);
          System.out.println("Number exists? " + numExists(number, numToFind));
}

Similar Messages

  • How can I find out the apn number of the battery without having it?

    I dont have the battery of my iphone 5 anymore but how can i find out the apn number of the battery? I would like to change it but i need to know the apn number to choose the right battery.

    Apple does not provide any user-serviceable parts (other than accessories or sometimes a SIM card tray).
    Therefore, there are no legitimate iPhone batteries available for sale anywhere.
    Anything you find will either be salvaged, counterfeit, or stolen.

  • How can I find out the total number of gigabytes of all my photos in Iphoto?

    How can I find out the total number of gigabytes of all my photos in Iphoto?

    In the Event mode open the Info window at the bottom left  (Command+i or click on the blue i button).  Then select all of the Events.  The number of photos and size will be shown in the Info window at the right.
    OT

  • How can I find out what port number my DB is using

    How would one find out what port number a database is using? Is there a SQL command that will allow us to do this?
    Thanks,
    oracle_newbie

    newbie
    Oracle databse assigns a dynamic port number for each established session. Usually, the common port is 1521 which is defined in you tnsnames.ora, however, this is used for requesting a dynamic port. Dynamic ports are within a ragne of 1000+. That's why it is hard to tell which port you are using at a certain time. You should have a network monitoring tool to check this accurately.
    Regards
    null

  • How do we find our own mobile number ?

    if no credit left , so how do we find our own mobile number ?
    Solved!
    Go to Solution.

    cpitchford wrote:
    Open contacts, tap top of screen to bring up button menu, select "My Information".. it'll show you your number in the list of info
    i thought that also but when i checked there was no number there, just a blank field

  • How do you find Apple Support phone number for warranty for Mac Mini?

    How do you find Apple Support phone number for warranty for Mac Mini?

    1-800-APL-CARE? Should be able to direct you to the proper person.

  • HT4061 How do I find the Device IMEI number for an iPad Mini?

    How do I find the Device IMEI number on an iPAD Mini?  It was not on the packaging or the back of the device.

    Settings > General > About

  • How do you find the iPad phone number for cellular data?

    How do you find the iPad phone number for cellular data?

    I know this post was a long time ago but people still seem to be viewing it.
    Quickest way:
    Via the iPad on 3G, go to http://m.telstra.com. The service number is then displayed and you are given the option to recharge.

  • How can you find your IPAD serial number in your itunes account if you have lost your IPAD

    How can you find your IPAD serial number through your itunes account if you have lost your IPAD

    If you registered it to your account then it should be on your support profile : https://supportprofile.apple.com/
    Or if you have a backup of it on your computer's iTunes then go into Edit > Preferences (iTunes > Preferences on a Mac), and on the Devices tab hover your mouse pointer over the iPad's backup :

  • How do I find out my online number if its not list...

    How do I find out my online number if its not listed in your accounts?
    I've lloked everywhere but can't find it for love or money?
    If anyone can solve this, you could develop an app!

    john211 wrote:
    How do I find out my online number if its not listed in your accounts?
    I've lloked everywhere but can't find it for love or money?
    If anyone can solve this, you could develop an app!
    If you don't see it when you logon to your account page at Skype.com, you no longer have it.
    About Me You can also use a IP Camera as your camera for Skype video Example Instructions

  • How do I find out my serial number on my mac computer for this app

    How do I find out my serial number on my computer for this app and eventhough I had the app for awhile how do I register it?

    Find your serial number quickly

  • How do i find out my serial number if my macbook pro was stolen

    how do i find out my serial number if my macbook pro was stolen?

    If you registered it, go to http://supportprofile.apple.com and sign in with your Apple ID. It should also be on the box it came in if you still have it.

  • How do i find out my mailbox number to set up voicemail

    how do i find out my mailbox number to set up voicemail

        bkengld,
    Let's set your voicemail up. There is a voicemail icon under the phone icon. By pressing this button it will ask you if you want a personalized greeting or a general greeting. It will walk you through each step.
    RobinD_VZW
    Follow us on twitter @VZWSupport

  • HT201299 How can I find my current OS number? (10.5, 10.6)

    How can I find my current OS number? (10.5, 10.6)

    This is the iPhone forum, not the Mac forum.  You should post questions about your Mac in the Mac forum.
    However, to answer your question this time, click on the black Apple logo in the top left corner of your Mac screen, then click on 'About this Mac'.  You'll see your OS version there.

  • How do I find lost IPads IMEI number? I have serial

    how do I find lost IPads IMEI number? I have serial
    <Edited by Host>

    Do you have a backup of it on your computer's iTunes ? If you do then try going into Edit > Preferences on your computer's iTunes and on the Devices tab hover your mouse pointer over the backup name, that should give you the MEID number : http://support.apple.com/kb/HT4061

Maybe you are looking for

  • IC WebClient_Field Classification in service ticket

    Hello, We're implementing CRM 4.0 with the "Interaction Center WebClient" (SAP Portal) and the transaction "service ticket" (we use for transaction type TSRV as a basis, and copied it in ZSRV). In the portal header data of our "service ticket", there

  • Failed to load keydecoder binaries - on installing Data Service XI 3.x

    Hi.. I wanted to install DS XI 3.x on WIndows 2003 Server. But after start setup, the error messages ' failed to load keydecoder binaries ' occurred and installation was interrupted.. Can anyone say the reason and solution? Please let me know.. THank

  • Can someone help with this simple application

    I am taking my first java class and there are limited resourses for the class as far as getting help with coding. Any hoo if any one can point me in the correct direction from the following information listed below I would be greatfull. I am trying t

  • Problem Uploading Converted Movie to Itunes

    I have a 30gig Ipod Video,and I downloaded a movie from 360Download,and I then used cucusoft.com to convert it, Now the converted movie is in a folder and I looked on the website of cucucsoft to look for the instructions to then upload the movie into

  • Changing transition changes time of clip before and after???

    When I add or change the transition time, after it renders, the time of the clip before and after the transition automatically changes. I've done it several times and it shortens the time of the clips before and after the transition. Why does it do t