CSE106 - Fundamentals of Web Design
Assignment 4
Details of the Student:
- Name: Thashan Anil Dasashish
- Enrollment ID: SAU/FET/BTECH(CSE)/2025/213
- Section: D
- Branch: B. Tech. CSE - Semester 2
- Email: thashan.dasashish2025@students.sau.ac.in
Index
Question 3:
Mirror Corridor
Given integers N and K, find the smallest non-negative integer X such that:
- N + X is a palindrome number
- N + X is divisible by K
If no such X exists for 0 ≤ X ≤ 1000000, print -1.
Input Format: Take N and K using prompt().
Output Format: Print X using alert().
Constraints: 1 ≤ N ≤ 10^6, 2 ≤ K ≤ 9
Solution:
Press the button to execute JS solution of the question.