Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how fix this error import java.util.*; import java.lang.*; import java.io.*; import java.lang.Math; publicclass Main { publicstaticint leftrightString(String S) { //this is default OUT int result

how fix this error

import java.util.*;

import java.lang.*;

import java.io.*;

import java.lang.Math;

publicclass Main {

publicstaticint leftrightString(String S) {

//this is default OUT

int result =0;

//write Logic here:

int i,j;

int count =0;

for(i =0; i < N; i++){

for(j =0; j < N; j++){

if(A[i] == A[j] && i != j)

break;

}

if(j == N ){

count++;

}

}

result = count ;

return result;

}

}

publicstaticvoid main(String args[])

{

Scanner sc=new Scanner(System.in);

//INPUT [uncomment & modify if required]

String S = sc.next();

//OUTPUT [uncomment & modify if required]

System.out.println(leftrightString(S));

}

}

Step by Step Solution

3.46 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

It seems like there are several issues with the code provided Syntax Error The class declaration lac... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Communications and Networking

Authors: Behrouz A. Forouzan

5th edition

73376221, 978-0073376226

More Books

Students also viewed these Programming questions