This is a verified interview question from Texas. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Stock Price Reverse Check - Texas Online Assessment NIT Bhopal PYQ" covers key patterns like Arrays.
"Pattern: 32 MCQS + 2 DSA Jasmine has a unique strategy for buying shares. Every day, she randomly selects **N** companies and checks their current share prices. She is interested in buying the shares of a company **only if the value remains unchanged after reversing its digits**. If the share price is negative, it is written with a leading '`-`' sign. The minus sign is **not** considered part of the digits while reversing. For each company, determine whether Jasmine will buy its shares. Print: * `"YES"` if the reversed number is equal to the original number. * `"NO"` otherwise. --- ## Input Format * First line contains an integer **N**. * Next **N** lines each contain an integer representing the share price. --- ## Output Format Print **N** lines. For each share price print: * `"YES"` if it remains unchanged after reversing its digits. * `"NO"` otherwise. ## Sample Input 1 ```text 2 313 -11 ``` ## Sample Output 1 ```text YES NO ``` --- ## Explanation * `313` reversed is `313`, so print **YES**. * `-11` represents a loss. Reversing the digits gives `11`, which is not equal to `-11`, so print **NO**. --- ## Sample Input 2 ```text 2 12 22 ``` ## Sample Output 2 ```text NO YES ``` --- ## Explanation * `12` reversed becomes `21`, so print **NO**. * `22` reversed remains `22`, so print **YES**."
Join thousands of developers practicing for Texas.