Unit 4 - OOPNotes
Unit 4 - OOPNotes
I/O Basics – Reading and Writing Console I/O – Reading and Writing Files. Generics: Generic Programming – Generic classes – Generic
Methods – Bounded Types – Restrictions and Limitations. Strings: Basic String class, methods and String Buffer Class.
1. I/O BASICS
(NOV/DEC 2021)(13)
2. How character streams are defined?(2) (NOV/DEC 2021)(13)
3. What are the uses of streams. What are the two types of streams ?(NOV/DEC
2020)
4. Explain in detail about reading and writing console in java with sample example program?
Java I/O (Input and Output) is used to process the input and produce the output based on the input. Java uses the concept of stream to
make I/O operation fast. The java.io package contains all the classes required for input and output operations.
A stream can be defined as a sequence of data. there are two kinds of Streams
Java byte streams are used to perform input and output of 8-bit bytes FileInputStream , FileOutputStream.
Character Streams
Java Character streams are used to perform input and output for 16-bit unicode. FileReader , FileWriter Standard Streams
• Standard Input: This is used to feed the data to user's program and usually a keyboard is used as standard input stream and
represented as System.in.
• Standard Output: This is used to output the data produced by the user's program and usually a computer screen is used to
standard output stream and represented as System.out.
• Standard Error: This is used to output the error data produced by the user's program and usually a computer screen is used to
standard error stream and represented as System.err.
ByteStream classes have been designed to provide functional features for creating and manipulating streams and files for reading and
writing bytes. Since the streams are unidirectional, they can transmit bytes in only one direction and therefore, Java provides two kinds of
byte stream classes: InputStream class and OutputStream class.
Input Stream Classes
Input stream classes that are used to read 8-bit bytes include a super class known as InputStream and number of subclasses for supporting
various input- related functions.
The super class InputStream is an abstract class, so we cannot create object for the class. InputStream class defines the methods to
perform the following functions:-
• Reading Bytes
• Closing Streams
• Marking position in Streams
• Skipping ahead in streams
• Finding the number of bytes in stream.
OutputStream Class
The super class InputStream is an abstract class, so we cannot create object for the class. InputStream class defines the methods to
perform the following functions:
• Writing Bytes
• Closing Streams
• Flushing Streams
Hierarchy of Output Stream Classes
OutputStream Method
Character Stream Vs Byte Stream in Java I/O Stream
A stream is a method to sequentially access a file. I/O Stream means an input source or output destination representing different types
of sources e.g. disk files.The java.io package provides classes that allow you to convert between Unicode character streams and byte streams
of non-Unicode text.
Character Stream
In Java, characters are stored using Unicode conventions. Character stream automatically allows us to read/write data character by character.
For example FileReader and FileWriter are character streams used to read from source andwrite to destination.
Java BufferedInputStream class is used to read information from stream. It internally uses buffer mechanism to make the performance
fast.
1. When the bytes from the stream are skipped or read, the internal buffer automatically refilled from the contained input
stream, many bytes at a time.
2. When a BufferedInputStream is created, an internal buffer array is created. Example of Java BufferedInputStream
try{
BufferedInputStream(fin);
int i;
while((i=bin.read())!=-1){
System.out.print((char)i);
bin.close(); fin.close();
}catch(Exception e){System.out.println(e);}
Java BufferedOutputStream class is used for buffering an output stream. It internally uses buffer to store data. It adds more efficiency than to
write data directly into a stream. So, it makes the performance fast.
For adding the buffer in an OutputStream, use the BufferedOutputStream class. Let's see the syntax for adding the buffer in an OutputStream:
In this example, we are writing the textual information in the BufferedOutputStream object which is connected to the FileOutputStream object.
The flush() flushes the data of one stream and send it into another. It is required if you have connected the one stream with another.
fout.close();
System.out.println("success");
Output:
Success
testout.txt
Java DataInputStream class allows an application to read primitive data from the input stream in a machineindependent way.
Java application generally uses the data output stream to write data that can later be read by a data input
stream.
In this example, we are reading the data from the file testout.txt file. import java.io.*; public class
System.out.print(k+"-");
}
Here, we are assuming that you have following data in "testout.txt" file:
JAVA
Output:
J-A-V-A
Success
Java DataOutputStream class allows an application to write primitive Java data types to the output stream in a machine-independent way.
Java application generally uses the data output stream to write data that can later be read by a data input stream.
Method Description
int size() It is used to return the number of bytes written to the data output
stream.
void write(int b) It is used to write the specified byte to the underlying output stream.
void write(byte[] b, int off, int It is used to write len bytes of data to the output stream.
len)
void writeBoolean(boolean v) It is used to write Boolean to the output stream as a 1-byte value.
void writeChar(int v) It is used to write char to the output stream as a 2-byte value.
void writeChars(String s) It is used to write string to the output stream as a sequence of
characters.
void writeByte(int v) It is used to write a byte to the output stream as a 1-byte value.
void writeBytes(String s) It is used to write string to the output stream as a sequence of bytes.
void writeUTF(String str) It is used to write a string to the output stream using UTF-8 encoding in
portable manner.
void flush() It is used to flushes the data output stream.
In this example, we are writing the data to a text file testout.txt using DataOutputStream class.
package com.javatpoint;
import java.io.*;
public class OutputExample {
public static void main(String[] args) throws IOException { FileOutputStream file = new
FileOutputStream(D:\\testout.txt);
DataOutputStream data = new DataOutputStream(file); data.writeInt(65);
data.flush(); data.close();
System.out.println("Succcess...");
}
}
Output:
Succcess...
testout.txt:
A
1.3 Reading and Writing Files
1. How to perform reading and writing files ? Explain with example(NOV/DEC 2020)
2. Explain in detail about the following with sample program
i) Reading from file ii) Writing in a file
A stream can be defined as a sequence of data. The InputStream is used to read data from a source and the OutputStream is used for writing
data to a destination.
The InputStream is used to read data from a source and the OutputStream is used for writing data to a destination. The two
important streams are FileInputStream and FileOutputStream Here is a hierarchy of classes to deal with Input and Output streams.
FileInputStream
Java FileInputStream class obtains input bytes from a file. It is used for reading byte-oriented data (streams of raw bytes) such as
image data, audio, video etc. Java FileInputStream example 1: read single character import java.io.FileInputStream;
try{
int i=fin.read();
System.out.print((char)i); fin.close();
}catch(Exception e){System.out.println(e);}
Note: Before running the code, a text file named as "testout.txt" is required to be created. In this file, we are having following content:
Output:
try{
fout.write(65); fout.close();
System.out.println("success...");
}catch(Exception e){System.out.println(e);}
Output:
Success
The content of a text file testout.txt is set with the data A. testout.txt
Write to a File
The next operation which we can perform on a file is "writing into a file". In order to write data into a file, we will use the FileWriter class and
its write() method together. We need to close the stream using the close() method to retrieve the allocated resources.
Let's take an example to understand how we can write data into a file.
WriteToFile.java
try {
FileOperationExample.txt file fwrite.write("A named location used to store related information is referred to as a File.");
} catch (IOException e) {
e.printStackTrace();
The next operation which we can perform on a file is "read from a file". In order to write data into a file, we will use the Scanner class. Here, we
need to close the stream using the close() method. We will create an instance of the Scanner class and use the hasNextLine() method
nextLine() method to get data from the file.
Let's take an example to understand how we can read data from a file.
ReadFromFile.java
// Importing the Scanner class for reading text files import java.util.Scanner; class
try {
System.out.println(fileData);
dataReader.close();
exception.printStackTrace();
}}}
Examples:
1. In the below example, we will use FileInputStream class to read the file.
Code:
// initializing x to 0
int x = 0;
System.out.print((char)x);
// closing a file
f.close();
catch(Exception e)
// printing exception
System.out.println(e);
}}
2. In the below example, we will use BufferedInputStream class to read the file.
Code:
import java.io.*; class main{ public static void main(String[] args) throws IOException {
try{
int x = 0;
System.out.print((char)x);
f2.close();
catch(Exception e){
// printing exception
System.out.println(e);
}}}
Output:
Available bytes: 24
3. In the below example we will use ByteArrayInputStream class to read the file.
Code:
import java.io.*; class main{ public static void main(String[] args) throws IOException { try{
FileInputStream("input.txt");
int x = 0;
String S = "";
S = S+(char)x;
// declaring ByteArrayInputStream
x = b1.read();
System.out.println();
b1.close();
catch(Exception e)
// printing exception
System.out.println(e);
}
}
Output:
2. GENERICS
1. Why parameterized types are important? Outline Java generics with an example. (NOV/DEC 2021)
2. Outline parameter type bounds with an example. (NOV/DEC 2021)
Generic programming enables the programmer to create classes,interfaces and methods that automatically works with all types of
data(Integer, String, Float etc). It has expanded the ability to reuse the code safely and easily.
1) Type-safety : We can hold only a single type of objects in generics. It doesn’t allow to store other objects.
2) Type casting is not required: There is no need to typecast the object. 3)Compile-Time Checking: It is checked at compile time so
problem will not occur at runtime. The good programming strategy says it is far better to handle the problem at compile time than
runtime.
• Generic class declaration defines set of parameterized type one for each possible invocation of the type parameters
Example:
T ob1; V ob2;
TwoGen(T o1, V o2)
void showTypes() {
T getob1()
return ob1;
V getob2()
return ob2;
}}
Like generic class, we can create generic method that can accept any type of argument. public class
System.out.println(element );
System.out.println();
Character[] charArray = { 'J', 'A', 'V', 'A'}; System.out.println( "Printing Integer Array" );
printArray( intArray );
}
2.3 Bounded type
The type parameters could be replaced by any class type. This is fine for many purposes, but sometimes it is useful to limit the types that
can be passed to a type parameter
Syntax :
Number>
T[] nums;
Stats(T[] o)
nums = o;
double average()
Integer inums[] = { 1, 2, 3, 4, 5 };
To use Java generics effectively, you must consider the following restrictions
• Cannot Overload a Method Where the Formal Parameter Types of Each Overload Erase to the Same Raw Type
3. STRINGS
1. Compare String & StringBuffer Class. (2) (NOV/DEC 2021)
2. List the methods in String Class. (2) (NOV/DEC 2021)
3. Write a Java program to count the number of vowels in a given sentence. (2) (NOV/DEC 2021)
4. Write a Java program to reverse the given sentence. (2) (NOV/DEC 2021)
String Literal - Java String literal is created by using double quotes. For Example: String s="welcome";
// create strings
// print strings
Creating strings using the new keyword class Main { public static void
}
}
27. String trim() removes beginning and ending spaces of this string.
28. static String valueOf(int value) converts given type into string. It is overloaded.
Example
public classstringmethod
{
public static void main(String[] args)
{
String string1 = new String("hello"); String string2 = new
String("hello"); if (string1 == string2)
{
System.out.println("string1= "+string1+" string2= "+string2+" are equal");
} else
{
System.out.println("string1= "+string1+" string2= "+string2+" are Unequal");
}
System.out.println("string1 and string2 is= "+string1.equals(string2));
String a="information";
System.out.println("Uppercase of String a is= "+a.toUpperCase()); String b="technology";
System.out.println("Concatenation of object a and b is= "+a.concat(b)); System.out.println("After concatenation Object a is=
"+a.toString()); System.out.println("\"RIT\'s\" is the greatest\\ college in chennai"); System.out.println("Length of Object a is=
"+a.length());
System.out.println("The third character of Object a is= "+a.charAt(2));
StringBuffer n=new StringBuffer("Technology");
StringBuffer m=new StringBuffer("Information");
System.out.println("Reverse of Object n is= "+n.reverse()); n= new
StringBuffer("Technology");
System.out.println("Concatenation of Object m and n is= "+m.append(n)); System.out.println("After concatenation of Object m is=
"+m);
}
}
Output
string1= hello string2= hello are Unequal string1 and string2 is= true
Uppercase of String a is= INFORMATION
Concatenation of object a and b is= informationtechnology
After concatenation Object a is= information
"Joseph's" is the greatest\ college in chennai
Length of Object a is= 11
The third character of Object a is= f
Reverse of Object n is= ygolonhceT
Concatenation of Object m and n is= InformationTechnology
Java StringBuffer class is used to create mutable (modifiable) String objects. The StringBuffer class in Java is the same as String
class except it is mutable i.e. it can be changed.
Mutable String:
A String that can be modified or changed is known as mutable String. StringBuffer and StringBuilder classes are used for
creating mutable strings.
The append() method concatenates the given argument with this String.
Program
Class StringBufferExample
Output:
Hello Compiler
The insert() method inserts the given String with this string at the given position. Program:
class StringBufferExample2
{
public static void main(String args[])
{
StringBuffer sb=new StringBuffer("Hello "); sb.insert(1,"Java");//now original string is changed
System.out.println(sb);//prints HJavaello
}
}
Output:
HJavaello
StringBuffer replace() Method
The replace() method replaces the given String from the specified beginIndex and endIndex.
sb.replace(1,3,"Java");
System.out.println(sb);//prints HJavalo
OUTPUT:
HJavalo
The delete() method of the StringBuffer class deletes the String from the specified beginIndex to endIndex. StringBufferExample4.java
class StringBufferExample4{ public static void main(String args[]){ StringBuffer sb=new StringBuffer("Hello"); sb.delete(1,3);
System.out.println(sb);//prints Hlo
OUTPUT
Hlo
StringBuffer reverse() Method
The reverse() method of the StringBuilder class reverses the current String. StringBufferExample5.java
System.out.println(sb);//prints olleH
} }
OUTPUT
OlleH
The capacity() method of the StringBuffer class returns the current capacity of the buffer. The default capacity of the buffer is 16. If the
number of character increases from its current capacity, it increases the capacity by (oldcapacity*2)+2. For example if your current
capacity is 16, it will be (16*2)+2=34. StringBufferExample6.java class StringBufferExample6{ public static void main(String args[]){
System.out.println(sb.capacity());//default 16 sb.append("Hello");
} }
OUTPUT
16
16 34
StringBuffer ensureCapacity() method
The ensureCapacity() method of the StringBuffer class ensures that the given capacity is the minimum to the current capacity. If it is greater
than the current capacity, it increases the capacity by (oldcapacity*2)+2. For example if your current capacity is 16, it will be (16*2)+2=34.
StringBufferExample7.java class StringBufferExample7{
System.out.println(sb.capacity());//default 16 sb.append("Hello");
System.out.println(sb.capacity());//now 70
} }
Output:
16
16
34
34
70
1. What is Barcode
2. Java API to Read Barcode from Image
3. Read Barcode from an Image
4. Recognize Barcode of Specific Type
5. Read Multiple Barcodes from an Image
6. Get X and Y Coordinates of Barcode
7. Read Barcode From Specific Region of Image
// This code example demonstrates how to read barcode multiple barcodes from an image. // The path to the image directory
String dataDir = "C:\\Files\\BarCode\\";
// Read all types of barcode available on the input image for (BarCodeResult result :
reader.readBarCodes()) {
System.out.println("CodeText: " + result.getCodeText());
System.out.println("Symbology type: " + result.getCodeType());
System.out.println("-------------------------"); }
// This code example demonstrates how to read barcode of a specific decode type from an image.
// The path to the image directory
String dataDir = "C:\\Files\\BarCode\\";
// This code example demonstrates how to read barcode from specific region of an image. // The path to the image directory
String dataDir = "C:\\Files\\BarCode\\";
// This code example demonstrates how to read X & Y region point of barcodes from an image.
// The path to the image directory
String dataDir = "C:\\Files\\BarCode\\";
// Initialize barcode reader
BarCodeReader reader = new BarCodeReader(dataDir + "Code39Std.png", DecodeType.ALL_SUPPORTED_TYPES);
Category - Easy
Create a C# program to record a video using Camera.
Category - Medium
Create a Java Program to read data through a barcode scanner.
Category - Hard
Implement Library Management System using the concepts learnt in Unit-4 (or)
Implement Railway Reservation System using the concepts learnt in Unit-4
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
MODEL EXAMINATION Branch : CSE
Sub Code : CS3391 Year/Sem: II/III
Sub Name : Object Oriented Programming
Part A (2 Marks)
Sl.no Questions Blooms
CO Level*
1 Write a Java program to reverse the given sentence. CO4 B3
16. Which of the following allows us to call generic methods as a normal method?
A. Type Interface
B. Interface
C. Inner class
D. All of the mentioned
22. Which of these type parameters is used for a generic class to return and accept a
number?
A. K
B. N
C. T
D. V
23. Which of the following is incorrect statement regarding the use of generics and
parameterized types in Java?
A. Generics provide type safety by shifting more type checking responsibilities to
thecompiler
B. Generics and parameterized types eliminate the need for down casts when using
JavaCollections
C. When designing your own collections class (say, a linked list), generics
andparameterized types allow you to achieve type safety with just a single class
definition as opposed to defining multiple classes
D. All of the mentioned
24. Which of the following allows us to call generic methods as a normal method?
A. Type Interface
B. Interface
C. Inner class
D. All of the mentioned
26. Which of the following statements is incorrect about the use of generic and
parameterized types in Java?
A. When designing your own class of collections, generic and parameterized types
allowyou to achieve type security with a single class definition rather than defining
multiple classes
B. Generic and parameterized types removes the need for top-down conversions
whenusing Java collections
C. Generic type in Java ensures type safety by transferring type checking responsibilities
tothe compiler
D. All the answers are true
NAME :
CLASS :
JAVA string
DATE :
20 Questions
A Both B No
C Yes
A length() B long()
C size() D count()
3. Which data type gets returned from length() method in String class?
A int B number
C String D double
4. String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
A toUpperCase() B changeUpperCase()
C toUpper() D convertUpperCase()
6. String txt = "Hello World";
System.out.println(txt.toUpperCase()); Choose the
correct output.
returns the index (the position) of the first returns the index (the position) of the first
C occurrence of a specified text in a string D occurrence of a specified text in a string
(excluding whitespace) (including whitespace)
8.
String x = "10";
String y = "20";
String z = x + y;
System.out.println(z); Guess
the output.
A 10 20 B 1020
C 30 D "10 20"
9.
What will be the output of below code?
A tfit B it of
C FIT D fit
10. Choose most appropriate purpose of trim() method in String?
A int B String
C char D boolean
12. What is the most appropriate way to check if two Strings are identical?
C string1.same(string2) D string1.equals(string2)
13. (Multiple answer question)
Pick all NON-primitive datatypes from below :
A String B int
C primitive D Array
14. What is the correct relation between length and last-index of array?
A last-index is always 1 more than the length B last-index is always 1 less than the length
last-index is 1 less than the length (but not
C last-index is always equal to the length D
always)
15.
String word = "A few good men"; What is
word.length()?
A 13 B 15
C 14
16.
String word = "A few good men"; What is
word.charAt(7) ?
A good men B 7
C g D o
17.
String word = "A few good men";
What is word.startsWith("A few") ?
A false B true
18. String word = "A few good men"; What is
word.endsWith("man") ?
A true B false
19.
String word = "A few good men"; What is
word.indexOf(“f”)?
A 0 B 1
C 3 D 2
20.
String word = "A few good men"; What is
word.substring(3, 7) ?
A few B few[space]
C ew go D ew g
NAME :
CLASS :
Java I/O Streams
DATE :
30 Questions
A getLine() B read()
C get() D readLine()
3. Which of these class is used to read characters and strings in Java from console?
A StringReader B InputStreamReader
C BufferedStreamReader D BufferedReader
4. Which of these class contains the methods print() & println()?
A System B System.out
C BufferedOutputStream D PrintStream
5. ……………………. class is used to increase the efficiency of input operations.
A FileInputStream B DataInputStream
C BufferedInputStream D PipeInputStream
6. A stream is a sequence of data.In Java a stream is composed of?
Character stream uses InputStream and Like in any other language, streams are
C D OutputStream classes for input and used for input and output operations. output
operation.
9. Which of these classes are used by character streams for input and output operations?
InputOutputStream
A null B EOF
C -1 D \0
11. Which is used to converts the byte-oriented stream into character-oriented stream?
A InputStreamReader B Console
C Scanner D DataInputStream
12. The PrintStream class provides methods to?
A True B False
C java.util D java.io
16. Which of these class is not related to input and output stream in terms of functioning?
A File B InputStream
C Reader D Writer
17. Which of these class is used to read and write bytes in a file?
A FileReader B FileInputStream
C FileWriter D InputStreamReader
18. Which of these method of InputStream is used to read integer representation of next available byte
input?
A get() B scanf()
C read() D getInteger()
19. What is the output of this program?
A abc B ABC
C AB D ab
20. What is the output of this program?
A AB B abc
C ABC D ab
A FileInputStream B InputStreamReader
C FileWriter D FileReader
22. Which of these method of FileReader class is used to read characters from a file?
A read() B scanf()
C get() D getInteger()
23. Which of these is a process of writing the state of an object to a byte stream?
A Serializable B FileFilter
C Externalization D ObjectInput
25. Which of these is method of ObjectOutputStream class used to write the object to output stream as
required?
A Write() B StreamWrite()
C writeObject() D write()
26. Which of these is method of ObjectIntputStream class used to read the object from input stream as
required?
A StreamRead() B readObject()
C Read() D read()
C D
Turning object in memory into stream of Turning stream of bytes into an object in
A B
bits memory
Turning stream of bits into an object in Turning object in memory into stream of
C D
memory bytes
C Turning object in memory into stream of bytes D Turning stream of bytes into an object in
memory
A public B private
C transient D protected
Turning stream of bits into an object in
B memory
String - Practice Programs
Parenthesis problem:-
1.https://leetcode.com/problems/generate-parentheses
2.https://leetcode.com/problems/score-of-parentheses
3.https://leetcode.com/problems/valid-parentheses
4.https://leetcode.com/problems/valid-parentheses
5.https://leetcode.com/problems/remove-outermost-parentheses
6.https://leetcode.com/problems/different-ways-to-add-parentheses/
7.https://leetcode.com/problems/remove-invalid-parentheses
8.https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses
9.https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses
10.https://leetcode.com/problems/longest-valid-parentheses/
1.https://leetcode.com/problems/number-of-wonderful-substrings
2.https://leetcode.com/problems/sum-of-beauty-of-all-substrings/
3.https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring
4.https://leetcode.com/problems/number-of-wonderful-substrings
1.https://leetcode.com/problems/isomorphic-strings
2.https://leetcode.com/problems/valid-anagram
3. https://leetcode.com/problems/additive-number
4.https://leetcode.com/problems/buddy-strings
5.https://leetcode.com/problems/longest-happy-prefix
6.https://leetcode.com/problems/increasing-decreasing-string
7.https://leetcode.com/problems/check-if-a-string-can-break-another-string
8.https://leetcode.com/problems/determine-if-two-strings-are-close
9.https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent
10.https://leetcode.com/problems/check-if-word-equals-summation-of-two-words
11.https://leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal
Palindromic string:-
1.https://leetcode.com/problems/palindrome-partitioning
2.https://leetcode.com/problems/palindrome-partitioning-ii
3.https://leetcode.com/problems/valid-palindrome
4.https://leetcode.com/problems/shortest-palindrome
5.https://leetcode.com/problems/palindrome-pairs
6.https://leetcode.com/problems/longest-palindrome
7.https://leetcode.com/problems/longest-palindromic-subsequence
8.https://leetcode.com/problems/find-the-closest-palindrome
9.https://leetcode.com/problems/palindromic-substrings
10.https://leetcode.com/problems/valid-palindrome-ii
11.https://leetcode.com/problems/longest-chunked-palindrome-decomposition
12.https://leetcode.com/problems/break-a-palindrome
13. https://leetcode.com/problems/can-make-palindrome-from-substring
14.https://leetcode.com/problems/palindrome-partitioning-iii
15.https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-
palindrom e
16.https://leetcode.com/problems/remove-palindromic-subsequences
16.https://leetcode.com/problems/construct-k-palindrome-strings
17.https://leetcode.com/problems/split-two-strings-to-make-palindrome
Sorting on String:-
1.https://leetcode.com/problems/sort-characters-by-frequency
2.https://leetcode.com/problems/custom-sort-string
1.https://leetcode.com/problems/longest-duplicate-substring
2.https://leetcode.com/problems/longest-string-chain
3.https://leetcode.com/problems/longest-common-subsequence
4.https://leetcode.com/problems/longest-happy-string
5.https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-
uniquecharacters
6.https://leetcode.com/problems/find-longest-awesome-substring
7.https://leetcode.com/problems/largest-substring-between-two-equal-characters
8.https://leetcode.com/problems/largest-odd-number-in-string