Question: Task 1 Propamining Lenguses longrightarrow Jeva 8 You are given an array S consisting of N strings. Every string is of the same length M

Task 1
Propamining Lenguses longrightarrow
Jeva 8
You are given an array S consisting of N strings. Every string is of the same length M. Your task is to find a palr of strings in array S, such that here exists a position in which both of the strings have the same lette oth the index in array S and the posittons in the strings are number is zero. (Pdt. Whave the same letter "b' in position 1. On the other hand or strin. "abc' and "bea' there does not exist a position in whit. they have the se veletter.
Write a inctions
cla:
Solution {public int[] solution
ring[] S): }
that, given a zero-indexed arroy S of N string streturns an arey describing a palr of stinges from 8 which share a common letter at some index. If there is no such paits the function should retum an empty array. If there is more than one cerrect answet the funetlon can retum any of them.
The result should be represented as an arroy containing three integers. The first two integers are the indexes in S of the strings belonging to the pair. The third integer is the postition of the common letter.
For S={'abc", "bea", "dbe], as above, the reault arroy should be reppesented as [0,2,1). Another correct answer is (2,0,1}, as the order of indexes of strings does not matter.
Ineeed help with the best performance code since I can complete this task but got only 26%. Thanks
Examples:
 Task 1 Propamining Lenguses longrightarrow Jeva 8 You are given an

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!