Delete lab3 directory

This commit is contained in:
xivihwa 2023-04-04 17:44:45 +03:00 committed by GitHub
parent 3bbb7c8e54
commit 6fc3cc244e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 59 deletions

View File

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -1 +0,0 @@
Main.java

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="openjdk-19" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/OperationsStrings.iml" filepath="$PROJECT_DIR$/OperationsStrings.iml" />
</modules>
</component>
</project>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,25 +0,0 @@
import java.util.HashSet;
public class Main {
public static void main(String[] args) {
String inputText = "Who are you? What is your name? Where are you from?";
int targetLength = 3;
try {
HashSet<String> uniqueWords = new HashSet<String>();
String[] sentences = inputText.split("[?]");
for (String sentence : sentences) {
String[] words = sentence.trim().split("\\s+");
for (String word : words) {
if (word.length() == targetLength) {
uniqueWords.add(word.toLowerCase());
}
}
}
System.out.println("Unique words of length " + targetLength + " in the input text are: " + uniqueWords);
} catch (Exception e) {
System.out.println("An error occurred: " + e.getMessage());
}
}
}

Binary file not shown.