Im just wondering why they ask about palindrome for a test and automation position whereas in reality we will naver use it in our daily test automation scenarios 🙄 since we verify UI interactions and modifications so i don't see when are we going to use the palindrome verification
TS Code : async function found_nearest_palindrome() { let number = 111; let found = 0; let next_found = 0; for (let i = 0; ; i++) { if (String(i) == String(i).split("").reverse().join("")) { next_found = found; found = i; if (i > number) { break; } } } let found_diff = String(number - found).replace("-", ""); let next_found_diff = String(number - next_found).replace("-", ""); if (found_diff < next_found_diff) { console.log(found); } else { console.log(next_found); } }
Sir we can use Robot classes for windows based application as well,correct me if I am wrong
Im just wondering why they ask about palindrome for a test and automation position whereas in reality we will naver use it in our daily test automation scenarios 🙄 since we verify UI interactions and modifications so i don't see when are we going to use the palindrome verification
public class NearestPalindrome {
static int number=100;
static int upper_position=0;
static int lower_position=0;
static int upper_palindrome=0;
static int lower_palindrome=0;
public static void main(String[] args) {
if(!findPalindrome(number)) {
for(int i=1;i0) {
r=temp%10;
sum=(sum*10)+r;
temp=temp/10;
}
if((value)==sum) {
System.out.print("Palindrome :"+value);
return true;
}
return false;
}
}
Upper and lower will never be equal. There is no need to check that
Hi sir , how to contact u, the email ID is showing as incorrect when I tried mailing u
TS Code :
async function found_nearest_palindrome() {
let number = 111;
let found = 0;
let next_found = 0;
for (let i = 0; ; i++) {
if (String(i) == String(i).split("").reverse().join("")) {
next_found = found;
found = i;
if (i > number) {
break;
}
}
}
let found_diff = String(number - found).replace("-", "");
let next_found_diff = String(number - next_found).replace("-", "");
if (found_diff < next_found_diff) {
console.log(found);
} else {
console.log(next_found);
}
}