[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.