Given a very large number. Check its divisibility by 15.
Input: 31 Output: No Input : num = "156457463274623847239840239 402394085458848462385346236 482374823647643742374523747 264723762374620" Output: Yes Given number is divisible by 15
Here, used accumulate function to sum up all the numbers.
Time complexity: O(number of digits)
This article is contributed by Striver. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- To check divisibility of any large number by 999
- Divisibility by 12 for a large number
- Check divisibility by 7
- Check divisibility in a binary stream
- Check the divisibility of Hexadecimal numbers
- Multiply large integers under large modulo
- Check if a large number is divisible by a number which is a power of 2
- Sub-string Divisibility by 3 Queries
- Sub-string Divisibility by 11 Queries
- Maximum path sum for each position with jumps under divisibility condition
- Divisibility by 64 with removal of bits allowed
- Repeated Unit Divisibility
- Divisibility by 3 where each digit is the sum of all prefix digits modulo 10
- Maximize profit when divisibility by two numbers have associated profits
- Number of factors of very large number N modulo M where M is any prime number
- Check if a large number is divisible by 11 or not
- Check if a large number is divisible by 3 or not
- Check if a large number is divisible by 4 or not
- Check if a large number is divisible by 8 or not
- Check if a large number is divisible by 6 or not