[Xiaomi] 2015 Xiaomi school recruitment's retrieval number judgment, 2015 million Retrieval

Source: Internet
Author: User

[Xiaomi] 2015 Xiaomi school recruitment's retrieval number judgment, 2015 million Retrieval
[Question]

Are you familiar with text strings? If a string is the same as the previous one, it is a text string. For example, "Shanghai tap water comes from the sea" is a text string. Now, let's look at a number as a string and ask if it is a return number? For algorithms with lower time complexity and space complexity, the score is higher.
C ++:
Bool isPalindromeNumber (long num );
Java:
Boolean isPalindromeNumber (long num );

[Code]

#include <iostream>using namespace std;bool IsPalindromeNumber(long num){    long reverseNum = 0;    long temp = num;    while(temp > 0){        reverseNum = reverseNum * 10 + temp % 10;        temp /= 10;    }    if(reverseNum == num){        return true;    }    else{        return false;    }}int main(){    long num;    cin>>num;    bool result = IsPalindromeNumber(num);    if(result){        cout<<num<<" is a palindrome number"<<endl;    }    else{        cout<<num<<" is not a palindrome number"<<endl;    }    return 0;}

[Expansion 1] string-based retrieval

bool IsPalindromeNumber(string num){    int len = num.length();    for(int i = 0;i < len/2;i++){        if(num[i] != num[len-1-i]){            return false;        }    }    return true;}

bool IsPalindromeNumber(string num){    int len = num.length();    for(int i = 0,j = len-1;i < j;i++,j--){        if(num[i] != num[j]){            return false;        }    }    return true;}


Please send me a link to the text-back questions. Thank you ......



Link: [Baidu] 2014 Baidu campus recruitment longest reply string

[Netease] string Text Segmentation



Question: When will the Xiaomi school recruit resume be delivered?

For campus recruitment, you can log on to the official website of Xiaomi. At the bottom of the page, you can add Xiaomi to Xiaomi. You can learn about Xiaomi's campus promotion plan and recruitment positions, there is no specific date for the specific deadline. If you want to join Xiaomi, we suggest you submit your resume as soon as possible. Thank you for your attention and support for Xiaomi.

Xiaomi enterprise Platform [Official Certification]

How to join Xiaomi school recruitment? Urgent

Let's talk about the story of rice noodles and millet --------- hengxin is mainly because Xiaomi is very nutritious and delicious, so many people like it, so that rice noodles often buy millet, but they can't buy it. As a result, rice noodles often go to a famous market to find Xiaomi rice noodles, but they haven't been found for a long time. rice noodles are helpless. However, rice noodles were not discouraged, and they had been persistently searching. After days, they finally saw a store named Xin nengqi in the famous market, and then found traces of Xiaomi. This story tells us that we must have perseverance in doing one thing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.