-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathFunnyString.java
More file actions
21 lines (20 loc) · 629 Bytes
/
Copy pathFunnyString.java
File metadata and controls
21 lines (20 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Scanner;
public class Solution {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t--!=0){
boolean isfunny = true;
String s = sc.next();
int l = s.length();
for(int i=1;i<l;i++){
if(Math.abs(s.charAt(i)-s.charAt(i-1))!=Math.abs(s.charAt(l-i)-s.charAt(l-i-1)))
isfunny = false;
}
if(isfunny)
System.out.println("Funny");
else
System.out.println("Not Funny");
}
}
}