Java Task.docx

  • Uploaded by: test
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Java Task.docx as PDF for free.

More details

  • Words: 161
  • Pages: 1
1. Count of sub-strings that are divisible by K? Given an integer K and a numeric string str (all the characters are from the range [‘0’, ‘9’]). The task is to count the number of sub-strings of str that are divisible by K. Example: Input: str = “33445”, K = 11 Output: 3 Sub-strings that are divisible by 11 are “33”, “44” and “3344” Input: str = “334455”, K = 11 Output: 6 2. Print a given matrix in spiral form Input: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Output: 1 2 3 4 8 12 16 15 14 13 9 5 6 7 1 3. Pairs which are Divisible by 4. Given an array if ‘n’ positive integers, count number of pairs of integers in the array that have the sum divisible by 4. Input: 1 5 22175 Output: 3 Explanation: Testcase 1: (2,2), (1,7) and (7,5) are the 3 pairs.

Related Documents

Java Java
June 2020 44
Java
November 2019 24
Java
November 2019 26
Java
December 2019 27
Java
November 2019 23
Java
November 2019 25

More Documents from ""

Metabolism.docx
December 2019 15
Mobile Claim.pdf
October 2019 21
Self Assessment 2018.pdf
October 2019 13
Java Task.docx
October 2019 21
2019_march 16-31.xlsx
November 2019 15