subject

Given a pattern as the first argument and a string of blobs split by | show the number of times the pattern is present in each blob and the total number of matches. input: the input consists of the pattern ("bc" in the example) which is separated by a semicolon followed by a list of blobs ("bcdefbcbebc|abcdebcfgsdf|cbdbesfb cy|1bcdef23423bc32" in the example). example input: bc; bcdefbcbebc|abcdebcfgsdf|cbdbesfbcy |1bcdef23423bc32output: the output should consist of the number of occurrences of the pattern per blob (separated by |). additionally, the final entry should be the summation of all the occurrences (also separated by |). example output: 3|2|1|2|8 where bc was repeated 3 times, 2 times, 1 time, 2 times in the 4 blobs passed in. and 8 is the summation of all the occurrences. (3+2+1+2 = 8)test 1: input: aa; kjlhaa|aaadsaaa|easaaad|saoutput: 4|4|2|0|10code to be used: import java. io. bufferedreader; import java. io. ioexception; import java. io. inputstreamreader; import java. nio. charset. standardcharsets; public class main {/** * iterate through each line of input. */public static void main(string[] args) throws ioexception {inputstreamreader reader = new inputstreamreader(system. in, standardcharsets. utf_8); bufferedreader in = new bufferedreader(reader); string line; while ((line = in. = null) {string[] splittedinput = line. split("; "); string pattern = splittedinput[0]; string blobs = splittedinput[1]; main. dosomething(pattern, blobs); }} public static void dosomething(string pattern, string blobs) {// write your code here. feel free to create more methods and/or classes}}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:10
For each of the following claims, determine whether they are true or false. justify your determination (show your work). if the claim is false, state the correct asymptotic relationship as o, θ, or ω. unless otherwise specified, lg is log2.(a) (b) (c) (d) (e) (f) (g) (h) (i) (j)n+1 =22n =2n =1 =ln2 n =n2 +2n−4 =33n = 2n+1 =√n = 10100 =o(n4) o(2n)θ(2n+7 ) o(1/n)θ(lg2 n) ω(n2 )θ(9n ) θ(2n lg n )o(lg n) θ(1)
Answers: 1
question
Computers and Technology, 22.06.2019 08:30
On the loan worksheet in cell c9 enter pmt function to calculate the monthly payment for the altamonte springs 2018 facilities loan. ensure that the function returns a positive value and set the reference to cells b5 and b6 as absolute references.
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
question
Computers and Technology, 24.06.2019 00:30
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
You know the right answer?
Given a pattern as the first argument and a string of blobs split by | show the number of times the...
Questions
question
Mathematics, 04.03.2022 17:50