INSTAGRAM FOLLOW ME OR ASK ME ANY HELP 1. FOLLOW MY PAGE 2. MY PROFILE 1. Array - Dup Element Current Langauge: C o...
Learning Module on Array
INSTAGRAM FOLLOW ME OR ASK ME ANY HELP
2. MY PROFILE
#include "common.h"
#include
char func(char *str)
{
char ch = '\0';
int i,j,a;
a=strlen(str);
for(i=0;i
{
#include "common.h"
#include
#include
char * func(char * str, int index, char ch){
char a[10];
int p=0,r=0,i=0;
int t=0;
int x,s,n,o;
r = strlen(a);
while(i <= r)
{
i++;
}
s = n+r;
o = p+n;
for(i=p;i
{
if(t
t=t+1;
a[o]=x;
o=o+1;
return str;
}}
Current Langauge: Java
public class Answer implements QuestionInterface {
@Override
public String func (String inputStr1, String inputStr2){
if(inputStr1==null||inputStr2==null)
return null;
else{
char[] str1=inputStr1.toCharArray();
char[] str2=inputStr2.toCharArray();
int s=str1.length,m=str2.length,k=0,i,j,l=0;
String st="";
for(i=0;i
for(j=0;j
if(str1[i]==str2[j])
{
st=st+str1[i];
str2[j]=str2[m-1];
l++;
m--;
}
}
}
return st;
}
}
}
Current Langauge: Java
public class Answer implements QuestionInterface {
@Override
public boolean func (String str){
char[] ch1=str.toCharArray();
int count=0;
for(int i=0;i
{
if(ch1[i]-ch1[i+1]==1||ch1[i+1]-ch1[i]==1)
{
count++;
}
}
if(count==str.length()-1)
return true;
else
return false;
}
}
public class Answer implements QuestionInterface {
@Override
public int [] func (int [] arr){
// write your code here
int l=arr.length;
int min,flag,i,j;
for(i=0;i
{
min=99999;flag=0;
for(j=i+1;j
{
if(arr[i]
{ min=arr[j];
flag=1;
} }
if(flag==1)
{
arr[i]=min;
}}
return arr;
}}
public class Answer implements QuestionInterface {
@Override
public String func (String str1, String str2){
if((str1==null&&str2==null))
return null;
if(str1==null)
return str2;
if(str2==null)
return str1;
String s="";int c=0;
int i=str1.length()-1;
int j=str2.length()-1;
while(i>=0&&j>=0)
{
int a=str1.charAt(i)-48;
int b=str2.charAt(j)-48;
int sum=a+b+c;
s+=sum%10;
c=sum/10;
i--;
j--;
}
while(i>=0)
{
int a=str1.charAt(i)-48;
int sum=a+c;
s+=sum%10;
c=sum/10;
i--;
}
while(j>=0)
{
int a=str2.charAt(j)-48;
int sum=a+c;
s+=sum%10;
c=sum/10;
j--;
}
if(c>0)
s+=c;
StringBuffer bf=new StringBuffer(s);
return bf.reverse().toString();
}
}
public class Answer implements QuestionInterface {
@Override
public int func (int [] arr, int sum){
int c=0;
for (int i=0;i
{
for (int j=i+1;j
if (arr[i]+arr[j] == sum)
c++;
}
return c;
}
}
public class Answer implements QuestionInterface {
@Override
public String func(String str)
{
if(str==null)
return null;
String s="";
int i=0,j,c;
while(i
{
c=0;
for(int j=0;j
{
if(str.charAt(i)==str.charAt(j))
c=1;
}
if(c==0)
s+=str.charAt(i);
i++;
}
return s;
}
}
public class Answer implements QuestionInterface {
@Override
public String func(String str, char ch)
{
// write your code here
if(str==null)
return null;
int d=str.length(),i,j;
char[] ch1=str.toCharArray();
String str1="";
for(i=0;i
{
if(ch1[i]==ch){
ch1[i]='#';
}
for(i=0;i
{
if(ch1[i]!='#')
{
str1+=ch1[i];
}
}
return str1;
}
}
public class Answer implements QuestionInterface {
@Override
public String func(String str)
{
// write your code here
if(str==null)
return null;
String s="";
int l=str.length()-1;
while(l>=0)
{
s+=str.charAt(l--);
}
return s;
}
}
public class Answer implements QuestionInterface {
@Override
public String func (String str1, int size){
// write your code here
if(str1==null)
return null;
if(size==0||size==1)
return str1;
if(size>str1.length()-1)
{ int i=0;
String s1="";
int j=str1.length()-1;
while(i
{
s1+=str1.charAt(j-i);i++;
}
return s1;
}
int l=str1.length();
int i=0;
int j=size-1;
String s="";
int c=0;
while(i
{
s+=str1.charAt(j);
j--;
if(j
{
c=i+1;
j=c+size-1;
if(j>l-1)
j=l-1;
}
i++;
}
return s;
}}
public class Answer implements QuestionInterface {
@Override
public String func (String str1, int n){
// write your code here
if(str1==null)
return null;
if(n==0)
return str1;
String s="";
int l=str1.length();
int i=0;
char[]a=new char[100];
while(i
{
a[(i+n)%l]=str1.charAt(i);
i++;
}
i=0;
while(i
{
s+=a[i];
i++;
}
return s;
}
public class Answer implements QuestionInterface {
@Override
public String func (String str){
if(str==null)
return null;
String s1="";
char []ch=str.toCharArray();
char chh=0;
int c=0;
str+='@';
for(int i=0;i
{
char h=str.charAt(i);
if(str.charAt(i)=='@')
break;
if(!Character.isDigit(h))
{
chh=str.charAt(i);
s1+=str.charAt(i);
}
else
{
int n=str.charAt(i)-48;
if(str.charAt(i+1)-48<9 div="">
{
n=n*10+(str.charAt(i+1)-48);
i++;
}
for(int j=0;j
9>
{
s1+=chh;
}
}
}
return s1;
}
}
@Override
public int func (int [] arr){
int m=0,mx=0,i;
mx=arr[0];
for(i=1;i
if(mx
m=mx;
mx=arr[i];
}
else if((mx>arr[i]&&marr[i]&&m==0&&m>arr[i]))
m=arr[i];
}
return m;
}
}
public class Answer implements QuestionInterface {
@Override
public String func (String str1, String str2){
// write your code here
if(str1==null&&str2==null)
return null;
if(str1==null)
return str2;
if(str2==null)
return str1;
int l=str1.length();
int l2=str2.length();
int i=0;
String s="";
if(l>l2)
{
for(i=0;i
s+=str1.charAt(i);
s+=str2.charAt(i);
}
for(;i
s+=str1.charAt(i);
}
else
{
for(i=0;i
s+=str1.charAt(i);
s+=str2.charAt(i);
}
for(;i
s+=str2.charAt(i);
}
return s;
}
}
public class Answer implements QuestionInterface {
@Override
public String func (String str1, String str2){
// write your code here
if(str1==null&&str2==null)
return null;
if(str1==null)
return str2;
if(str2==null)
return str1;
int l=str1.length();
int l2=str2.length();
int i=0;
String s="";
if(l>l2)
{
for(i=0;i
s+=str1.charAt(i);
s+=str2.charAt(i);
}
for(;i
s+=str1.charAt(i);
}
else
{
for(i=0;i
s+=str1.charAt(i);
s+=str2.charAt(i);
}
for(;i
s+=str2.charAt(i);
}
return s;
}
}
About author: Guptajiii
Cress arugula peanut tigernut wattle seed kombu parsnip. Lotus root mung bean arugula tigernut horseradish endive yarrow gourd. Radicchio cress avocado garlic quandong collard greens.