Remainder When Divided By 11

You are given a number N. You need to find the remainder when N is divided by 11.

Note :
Number N may be very large.
Input format :
The first line contains an integer 'T' denoting the number of test cases to be run. The 'T' test cases follow. 

The first line of each test case contains a single number 'N' in the form of a string.
Output Format :
For each test case, print an integer denoting the remainder when 'N' is divided by 11.
Constraints :
1 <= T <= 5
1 <= length of N <= 10 ^ 6

Time Limit: 1 sec
CodingNinjas
author
2y
Using Modulo Property
  1. Since the number is very large we can not simply calculate N % 11.
  2. Now, any number say 256 % 11 can be calculated as (25*10 + 6)%11. Which in turn can be calculated as (( 25*10)%11...read more
Help your peers!
Add answer anonymously...
Amazon Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter