diff --git a/.classpath b/.classpath index 2846539..4c0579d 100644 --- a/.classpath +++ b/.classpath @@ -8,10 +8,11 @@ - + - + + diff --git a/build/classes/.gitignore b/build/classes/.gitignore index 4e7e508..c6ca2cf 100644 --- a/build/classes/.gitignore +++ b/build/classes/.gitignore @@ -1 +1 @@ -/controller/ +/service/ diff --git a/build/classes/testing/TestFlamesCheckService.class b/build/classes/testing/TestFlamesCheckService.class new file mode 100644 index 0000000..a1dc758 Binary files /dev/null and b/build/classes/testing/TestFlamesCheckService.class differ diff --git a/src/service/FlamesCheckService.java b/src/service/FlamesCheckService.java index a8c006a..cb2d9ca 100644 --- a/src/service/FlamesCheckService.java +++ b/src/service/FlamesCheckService.java @@ -1,9 +1,111 @@ package service; - -// Create a class called FlamesCheckService -// FlamesCheckService has a method findFlames to find the flames between two names -// char findFlames(String name1, String name2) takes two strings as arguments -// Your task is to calculate the flames value and return the corresponding character as output -// You must return only the following values ['f','l','a','m','e','s'] -// change the return value at the end of the method corresponding to your return value - +import java.util.*; +class flames +{ + public static char findFlames(String name1, String name2) + { + name1 = name1.toLowerCase(); + name2 = name2.toLowerCase(); +String n1[] = name1.split(" "); +String n2[] = name2.split(" "); +name1=""; +name2=""; +int len1=n1.length; +int len2=n2.length; +for(int i=0;i