Contest Link import java.util.*; class Solution{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ String jewels = sc.next(); StringBuilder s = new StringBuilder(); s.append(jewels); int count = 0; while(true){ int temp = 0; for(int i=0;i<s.length()-1;i++){ if(s.charAt(i)==s.charAt(i+1)){ count++; ...
Question Link import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class Solution { static class SinglyLinkedListNode { public int data; public SinglyLinkedListNode next; public SinglyLinkedListNode(int nodeData) { this.data = nodeData; this.next = null; } } static class SinglyLinkedList { public SinglyLinkedListNode head; public SinglyLinkedListNode tail; public SinglyLinkedList() { ...
Comments
Post a Comment