Question
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started