November 28, 2021

English to malayalam translation java code

Hi Team

English to Malayalam translation java code is available in GitHub


The translation is not 100% accurate , but the logic remains the same.you can modify the code accordingly, you can even raise the bug in the git itself. The translation will not take any time, performance is high, developed using plain java code.


https://github.com/consumerfed

Please comment and revisit the blog

November 14, 2021

Wipro interview question - how to move the said value to one end of an array



package com.interviewquestions.wipro;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
 * 
 * @author nao jinguji
 *
 */
public class Wipro {

public static void main(String[] args) {
// List<Integer> input = List.of(2,1,2,2,2,3,4,2);
// List<Integer> input = Arrays.asList(arr);
// int toMove = 2;
/*
List<Integer> output = new ArrayList(input.size());
for(int i :input) {
if(i!=toMove) {
output.add(i);
}
}
int len = input.size() -output.size();
for(int i =0; i<len; i++ ) {
output.add(toMove);
}
System.out.println(output);
System.out.println("------------"); */
int[] input = {2,1,2,2,2,3,4,2};
int toMove = 2;
int ptr = 0;
for(int i =0; i<input.length; i++ ) {
int value = input[i];
if(value!=toMove) {
input[ptr] = value;
input[i] = toMove;
ptr++;
}
}
for(int i =0; i<input.length; i++ ) {
System.out.print(input[i]);
}
}

}

Facebook comments