es
Feedback

¡No caigas en manos de tramposos! Telemetrio encuentra y marca estos canales 👉 Si quieres ver la etiqueta, suscríbete

Java programming for beginners

Java programming for beginners

Ir al canal en Telegram

Learn java programming through quizzes and videos

Mostrar más
El país no está especificadoLa categoría no está especificada
2 941
Suscriptores
Sin datos24 horas
Sin datos7 días
Sin datos30 días
Archivo de publicaciones
1. Playing with Number static int[] shiftArray(int input1, int[] input2, int input3) { int ar[]=new int[input2.length]; int j=0; for(int i=input3;i<input2.length;i++) { ar[j++]=input2[i]; } for(int i=0; i<input3;i++) { ar[j++]=input2[i]; } return ar; } Test cases input1=7; input2[]= {1,2,3,4,5,6,7}; input3=2; output: 3 4 5 6 7 1 2 Array Sort(nick checks) private static int getCount(int input1, int[] input2) { int ar[]=new int[input2.length]; for(int i =0;i<input2.length;i++) { ar[i]=input2[i]; } Arrays.sort(ar); int num=ar[0]; for(int i=0;i<input2.length;i++) { if(ar[i]!=num) return 0; num++; } return 1; } Test Case: input1:6 input2[]: {3,7,2,5,4,6} output: 1 2. Fancy Occurrence private static String fancyOcc(String input1, String input2) { String s=""; char com=input2.charAt(0); for(int i= 0; i<input1.length();i++) { char ch=input1.charAt(i); if(ch!=com) s=s+ch; } return s; } Test Case: input1:Welcome to metti input2:i output: Welcome to mett 3. String Within String private static String isPermutation(String input1,String input2) { input1=input1.toLowerCase(); input2=input2.toLowerCase(); int arr1[] = new int[26]; int arr2[] = new int[26]; for(int i=0; i<input1.length();i++) { char ch = input1.charAt(i); arr1[ch-97]++; } for(int i=0;i<input2.length();i++) { char ch1 = input2.charAt(i); arr2[ch1-97]++; if(arr1[ch1-97]<arr2[ch1-97]) return "no"; } return "yes"; } Test Case: input1: abab input2: ab output: yes 4. Palindrome private static int isPalindrome(String input1) { int j = input1.length(); for(int i=0;i<s.length()/2;i++) { char ch= input1.charAt(i); if(ch!= input1.charAt(j-1)) return 0; j--; } return 1; } Test Case: input1: level output: 1 5. Max occurring character private static String maxOccurance(String input1) { char[] c=new char[26]; String s=""; for(int i=0;i<input1.length();i++) { char ch= input1.charAt(i); c[ch-97]++; } int max=0; for(int i=1;i<26;i++) { if(c[max]<c[i]) max=i; } for(int i=0;i<26;i++) { if(c[i]==c[max]&&i!=max) return "0"; } return s+(char)(max+97); } Test cases: input1 : abcdd output : d 6. Number Sum private static int sum(int input1, int[] input2) { int max=input2[0]; int min=input2[0]; for(int i=1;i<input2.length;i++) { if(max<input2[i]) max=input2[i]; if(min>input2[i]) min=input2[i]; } return max+min; } Test cases: input 1: 7 input 2: { 7,2,6,15,54,10,23} output : 56 7. Anagram private static String isAnagarm (String input1,String input2) { int n1 = input1.length(); int n2 = input2.length(); if (n1 != n2) return "no"; input1=input1.toUpperCase(); input2=input2.toUpperCase(); int a[]= new int[26]; int a2[]= new int[26]; for(int i=0;i<n1;i++) { char ch= input1.charAt(i); a[ch-65]++; } for(int i=0;i<n2;i++) { char ch= input2.charAt(i); a2[ch-65]++; } for (int i = 0; i < 26; i++) if (a[i] != a2[i]) return "no"; return "yes"; } Test cases: input1:build input : dubli output : yes 8. Coin Counts private static int getcount(int input1) { int coin=0; while(input1!=0) { coin=coin+(input1*input1); input1--; } return coin; } Test cases: input1 : 2 output : 5 9. Electro Static private static int electroStatic(int[] input1, String input2, int input3) { int sum=0; for(int i = 0;i<input3;i++) { char ch = input2.charAt(i); switch(ch) { case 'P': sum=sum+input1[i]; break; case 'N': sum=sum-input1[i]; break; } } return sum*100; } Test cases: input1 : {4,3,5} input2 : PNP input3 : 3 output : 600 10. Reverse Array public static int[] reverseArray(int [] input1,int input2) { int [] ars=new int[input2]; int k=0; for(int i=input2-1;i>=0;i--) { ars[k]=input1[i]; k++; } return ars; }
10 mar 2022, 05:53

Gowtham Sai, you were banned (spam).
22 mar 2022, 04:44

Is chat gpt is very good?
22 mar 2023, 01:00

Ashok Saraswathi welcome to the group. To learn how to crack coding exams
12 mar 2022, 22:04

Any mails came from cognizant about 2nd April gd round
08 abr 2022, 02:02

Bata Dena mera y sahi hh ya nhi
02 ene 2022, 05:14

Premananda Panda welcome to the group. To learn how to crack coding exams
13 nov 2023, 11:25

16 mar 2022, 02:15

Can anyone say the pattern of this exam Mindtree SpeechX
03 feb 2022, 09:42

Please help me
15 mar 2022, 06:59

05 mar 2022, 03:00

Yup
14 mar 2022, 10:24

I guess i didn't clear round 1 so they provided again one chance
06 feb 2022, 23:10

B
08 feb 2022, 03:28

Which one is better A. Software developer B.Systems Eng C.Networking Which one should i go for please help
29 mar 2023, 17:20

sumit k welcome to the group. To learn how to crack coding exams
06 mar 2022, 02:26

Sss: Accenture answers Speak Affected Play Hated Sister till at Limonene and cinemol Both The United Kingdom Drinking Ashamed of my son Accenture answers 30)1 Temporary 2) no correction Sent word Extol
12 mar 2022, 23:10

28 ene 2023, 05:29

B
06 feb 2022, 06:39

Coding
20 feb 2022, 12:03

Utilizamos cookies para mejorar tu experiencia de navegación.
Al hacer clic en «Aceptar todo», aceptas la política de uso de cookies.