Sort by

recency

|

199 Discussions

|

  • + 0 comments
    import java.util.*;
    
    public class Main{
        
       static Iterator func(ArrayList mylist){
          Iterator it=mylist.iterator();
          while(it.hasNext()){
             Object element = it.next();
             if(element instanceof String)//Hints: use instanceof operator
    
                break;
            }
          return it;
          
       }
      
       @SuppressWarnings({ "unchecked" })
       public static void main(String []args){
          ArrayList mylist = new ArrayList();
          Scanner sc = new Scanner(System.in);
          int n = sc.nextInt();
          int m = sc.nextInt();
          for(int i = 0;i<n;i++){
             mylist.add(sc.nextInt());
          }
          
          mylist.add("###");
          for(int i=0;i<m;i++){
             mylist.add(sc.next());
          }
          
          Iterator it=func(mylist);
          while(it.hasNext()){
             Object element = it.next();
             System.out.println((String)element);
          }
       }
    }
    
  • + 0 comments

    the airbrush video watermark removal tool can be instrumental in content curation and aggregation. Platforms that aggregate content from multiple sources, such as news outlets, educational websites удалить водяной знак, or entertainment channels, often face the challenge of standardizing content presentation. Watermarks from various contributors can create a disjointed viewing experience. By removing these marks, the tool helps create a more unified and aesthetically pleasing presentation, improving the overall user experience on these platforms. This capability is particularly valuable for content creators, curators, and digital media companies looking to maintain a consistent visual identity.

  • + 1 comment

    Object element = it.next(); if(element instanceof String&&element.equals("###"))

  • + 2 comments

    i don't understand why writing the code like this:

         Object element = it.next();
         if(element instanceof String && !element.equals("###"))
    

    only prints "java"

    help me, please!

  • + 0 comments

    SIMPLE SOLUTION WOULD BE :- public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */

      Scanner sc = new Scanner(System.in);
      int m = sc.nextInt();
      int n = sc.nextInt();
      ArrayList myList = new ArrayList();
      for(int i=0;i < m;i++){
          myList.add(sc.nextInt());
      }
       myList.add("###");
    
       for(int j=0;j < n;j++){
          myList.add(sc.next());
      }
    
        int index = myList.indexOf("###");
        for(int i = index+1 ; i < myList.size(); i++){
            System.out.println(myList.get(i));
        }
    }